<?xml version="1.0" encoding="windows-1252"?>
<node id="990844" title="Re^3: HTML Form &gt; PERL Script in UTF-8 issue" created="2012-08-30 16:24:15" updated="2012-08-30 16:24:15">
<type id="11">
note</type>
<author id="990534">
Jishanator</author>
<data>
<field name="doctext">
&lt;p&gt;HTML Form = Saved as UTF-8 File. Post &gt; form.pl&lt;p&gt;

&lt;p&gt;In a required file, I set binmode (STDOUT, "utf8"); Then from the form.pl, I call a require that goes through a foreach loop that does this:&lt;/p&gt;

&lt;code&gt;
#!/usr/bin/perl

use Encode;

foreach $field (@fields) {
$input{$field} = Encode::decode('UTF-8', $input{$field});
}
&lt;/code&gt;
&lt;p&gt;From form.pl, information is printed out to the user for them to confirm, when submitted, we move to form2.pl.&lt;/p&gt;

&lt;p&gt;form2.pl outputs everything into an external file.. which then concludes to success.pl which pulls the information from the external file and displays it one last time in a sort of "receipt" manner, for them to print or save.&lt;/p&gt;

&lt;p&gt;So to summarize the process, HTML Form &gt; form.pl (converts through foreach to utf8) &gt; form2.pl &gt; success.pl (converts through foreach again). If for example, form.pl doesn't convert, the information is all different in success. I'm afraid this might bite me in the ass in a later stage.&lt;/p&gt;
I posted this, forgot to login...</field>
<field name="root_node">
990536</field>
<field name="parent_node">
990843</field>
</data>
</node>
