HTML Form = Saved as UTF-8 File. Post > form.pl
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:
#!/usr/bin/perl
use Encode;
foreach $field (@fields) {
$input{$field} = Encode::decode('UTF-8', $input{$field});
}
From form.pl, information is printed out to the user for them to confirm, when submitted, we move to form2.pl.
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.
So to summarize the process, HTML Form > form.pl (converts through foreach to utf8) > form2.pl > 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.</p |