Kazuma Shiraiwa wrote:
> Hi,
>
> Template::Filters 2.86 "uri_filter" and "url_filter" use utf8::encode.
>
> At least utf8::encode has problem in Japanese character without utf8 flag.
> view "sample.pl".
> and view "Template-Filter.patch".
>
> Please use this patch when it is good.
>   
Hi,

Your code is broken if you have characters outside of latin-1 in memory
without the utf8 flag on.  Do something like:

   use Encode;
   my $euc_jp_octets = read_file('/path/to/the/file'); # or whatever
   my $data = Encode::decode('euc-jp', '$euc_jp_octets);
   ...
   $data =~ s/.../.../; # whatever... anything that modifies $data
   ...
   print Encode::encode('euc-jp', $data);

The decode/encode is also needed for utf8... anything other than ASCII,
basically.

Regards,
Jonathan Rockway

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to