[Padre-dev] Document cannot be saved if it has CJK characters.

Keedi Kim keedi at perl.kr
Thu Nov 27 04:44:29 PST 2008


Hi, :-)

On my linux box which locale is ko_KR.UTF-8,
Padre cannot save document if it has CJK characters.

If I wrote perl script with only english characters, everything is ok.
But If I put Hangul(Korean Characters) and save it,
then following error message occurs and cannot save document:

Could not save: Wide character in syswrite at
/usr/local/share/perl/5.8.8/File/Slurp.pm line 330.

Padre::Document.pm:
> sub save_file {
>     ...
>     require File::Slurp;
>     eval {
>         File::Slurp::write_file($filename, {binmode => ':raw'}, $content);
>     };
>     ...
> }

To escape this problem, I have to set binmode and encode contents:
> eval {
>     use Encode 'encode';
>     File::Slurp::write_file($filename, {binmode => ':utf8'},
encode('utf-8', $content));
> };

That is not an answer since not all users use utf-8.
And I think Padre might need ability that saving documents
with another encodings which includes:

1. encoding of document (default?)
2. or Padre default settings
3. or user could select.

Thanks, :-)

-- 
Best regards,

Keedi Kim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.perlide.org/pipermail/padre-dev/attachments/20081127/0f3ff459/attachment-0001.htm 


More information about the Padre-dev mailing list