[Padre-dev] Document cannot be saved if it has CJK characters.
Keedi Kim
keedi at perl.kr
Thu Nov 27 19:54:26 PST 2008
I thinks so. If we use open(), etc directly,
may be we could handle various encoding task more easier and clearer.
And encoding character-set is similar to language setting.
Like Eclipse, may be wee need
* use system default character-set setting in Preference
* or his/her own character-set setting in Preference
* and character-set setting for this documents in FileChooserDialog
2008/11/28 Adam Kennedy <adamkennedybackup at gmail.com>
> I get the feeling we need to abandon File::Slurp. It doesn't buy us a
> whole lot, adds a dependency, and adds another layer of indirection
> between us and what is actually happening when writing to disk.
>
> Adam K
>
> 2008/11/27 Keedi Kim <keedi at perl.kr>:
> > 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
> >
> >
> > _______________________________________________
> > Padre-dev mailing list
> > Padre-dev at perlide.org
> > http://mail.perlide.org/mailman/listinfo/padre-dev
> >
> >
> _______________________________________________
> Padre-dev mailing list
> Padre-dev at perlide.org
> http://mail.perlide.org/mailman/listinfo/padre-dev
>
--
Best regards,
Keedi Kim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.perlide.org/pipermail/padre-dev/attachments/20081128/8554677e/attachment.htm
More information about the Padre-dev
mailing list