[Padre-dev] utf8 patch
Gabor Szabo
szabgab at gmail.com
Mon Nov 3 02:32:22 PST 2008
don't worry about that.
I can revert the commit I made in SVN.
Gabor
2008/11/3 Fayland Lam <fayland at gmail.com>:
> 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.
More information about the Padre-dev
mailing list