NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Re: Using encoding and CGI Sessions/Cookies (Score:1)
What are you trying to achieve? The Encode module is enough for most cases. Read the first two of http://p3rl.org/UNI [p3rl.org].
Reply to This
Re: (Score:2)
The truth is that I tried to not use the encoding pragma. I do not like it as well. I prefer to binmode file handles and normally that works.
But with CGIs I get some problems. First, I am not able to binmode Template Toolkit when it opens templates. Or at least I can't find documentation on that.
The other problem is how to control the encoding from the environment variables, from CGI param and other stuff like that. But for these I think my current solution uses Encode already.
I'll fight with this script la
Re: (Score:1)
my $tt = Template->new({ENCODING => 'utf8',})Documented in http://search.cpan.org/perldoc?Template::FAQ#Why_do_I_get_rubbish_for_my_utf-8_t emplates? [cpan.org].
$tt->process($infile, $vars, $outfile, {binmode => ':utf8'},)Documented in http://search.cpan.org/perldoc?Template#process(%24template%2C_%5C%25vars%2C_%24 output%2C_%25options) [cpan.org].
Re: (Score:2)
Encode seems to have problems by itself.
Can't locate object method "renewed" via package "Encode::utf8" at /usr/lib/perl5/site_perl/5.10.0/Encode.pm line 174. ,
And this happens from time to time... :-(