[Padre-dev] Fwd: STC and unicode issue in Padre

Gabor Szabo szabgab at gmail.com
Tue Jul 7 00:58:29 PDT 2009


This is a thread that started on the wxperl list, then went off-list
but the best if
at least the padre-dev people see it.

Gabor


---------- Forwarded message ----------
From: Gabor Szabo <szabgab at gmail.com>
Date: 2009/7/5
Subject: Re: STC and unicode issue in Padre
To: Carsten Zandecki <service at mediaminds.de>


Hi Carsten,


On Sun, Jul 5, 2009 at 4:25 PM, Carsten Zandecki<service at mediaminds.de> wrote:
> Hi,
> i looked a while at your source code of Padre 0.27 (latest version?)... but
> i can't even find the place where you do multiple document handling via STC.
> Don't you change document pointers after switching files over notebook tabs?

The latest version is 0.38 but soon we will release 0.39
For every tab we have a separate STC instance so we don't need to swap them.


>
> Then I tested Padre 0.27 and everything works fine for me (german umlauts
> etc. where displayed correctly also after hitting backspace or del) ...

I checked it again on Ubuntu and 0.27 has the same issues with the Hungarian
vowels. What operating system do you run ?


> Btw... there is bug in opening file names with german umlauts (ascii
> characters > 127) which could be solved by reading the current system
> codepage and decoding it for perls internals.

I'll check this.


> If you don't STC's multiple document handling (do you use threads?)  i
> probably can't help and my solution doesn't work.

We also use threads but not for the document handling.


> Also you have to take care about encoding generally. Input/Output ... For
> that i convert all data to current systems codepage which works fine (in my
> personal editor), which might be a solution to your problem, too ...

We do that in Padre::Document load_file and save_file

Gabor

>
> Greetz,
> Carsten Zandecki ...
>
> --
>
>
>
>>> Hi there,
>>> i remember this behaviour and use the following solution.
>>>
>>> Herbert Breuning told me to change the codepage to UTF-8, which first
>>> doesn't worked for me.
>>> But in the meantime I found out that i had to set the codepage for each
>>> scintilla document. It is not enough to set codepage only for the
>>> scintilla
>>> control - i think.
>>>
>>> So i set the codepage directly after changing the scintilla document
>>> pointer
>>> (or maybe, it is enough just to set the codepage after creating a
>>> document -
>>> which i haven't tested yet ... ).
>>>
>>> This works for me:
>>>
>>> $self->{Editor}->AddRefDocument($doc);
>>> $self->{Editor}->SetDocPointer($self->{Buffer}[$page][0]);
>>> $self->{Editor}->ReleaseDocument($self->{Buffer}[$page][0]);
>>>
>>> $self->{Editor}->SetCodePage(65001);
>>>
>>> After that you just have to ensure that your file data is UTF-8.
>>>
>>> Hope it helps ...
>>>
>>
>> We set the code page at the time we create the editor object:
>>
>> http://padre.perlide.org/trac/browser/trunk/Padre/lib/Padre/Wx/Editor.pm#L116
>>
>> Still after pressing Del I cannot type ő and ű
>> other Hungarian vowels can be typed and if I press any key (including
>> the shift or Ctrl)
>> after that the above two characters can be aslo typed.
>>
>>
>> if you have time, I'd really appreciate if you took a look at Padre and
>> how to
>> fix this issue there ?
>>
>> Gabor
>>
>>
>


More information about the Padre-dev mailing list