[Padre-dev] utf8 patch
Fayland Lam
fayland at gmail.com
Mon Nov 3 02:30:23 PST 2008
Sorry, it's a correct one.
On Mon, Nov 3, 2008 at 6:29 PM, Fayland Lam <fayland at gmail.com> wrote:
> well, it's not OK. when I save it, it's not a real utf8, hmm
> I don't know what's wrong. but for now, I just give a patch to roll
> back the code.
>
> Thanks.
>
> On Mon, Nov 3, 2008 at 11:49 AM, Fayland Lam <fayland at gmail.com> wrote:
>> Index: lib/Padre/Document.pm
>> ===================================================================
>> --- lib/Padre/Document.pm (revision 673)
>> +++ lib/Padre/Document.pm (working copy)
>> @@ -272,6 +272,7 @@
>> warn $@;
>> return;
>> }
>> + utf8::decode($content);
>> $self->{_timestamp} = $self->time_on_file;
>> my $current_type = Padre::Util::newline_type($content);
>> if ($current_type eq 'None') {
>>
>> it fixes the read problem I think.
>> padre crashes when I open a utf8 file without this line.
>> so we should add this line.
>>
>>
>> @@ -314,6 +315,9 @@
>> my $filename = $self->filename;
>> #my $newline_type = $self->get_newline_type;
>>
>> + if ( $content && utf8::is_utf8($content) ){
>> + utf8::encode( $content );
>> + }
>> eval {
>> File::Slurp::write_file($filename, {binmode => ':raw'},
>> $content);
>> };
>>
>>
>> well, it's not so good.
>> it would change file encode indeed. so ignore it is another choice.
>>
>> Thanks.
>>
>> --
>> Fayland Lam // http://www.fayland.org/ Foorum based on Catalyst //
>> http://www.foorumbbs.com/
>>
>
>
>
> --
> Fayland Lam // http://www.fayland.org/
> Foorum based on Catalyst // http://www.foorumbbs.com/
>
--
Fayland Lam // http://www.fayland.org/
Foorum based on Catalyst // http://www.foorumbbs.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: de-utf8.patch
Type: application/octet-stream
Size: 657 bytes
Desc: not available
Url : http://mail.perlide.org/pipermail/padre-dev/attachments/20081103/480f4770/attachment.obj
More information about the Padre-dev
mailing list