Thread: [Boa Constr] Search text and unicode build
Status: Beta
Brought to you by:
riaan
|
From: le d. <le....@la...> - 2008-02-25 13:37:03
|
Hello, I'm using boa-constructor-0.6.1.src.win32.exe on windows xp (sources installed in C:\python25) with python-2.5.1.msi. I use it with wxPython2.8-win32-unicode-2.8.7.1-py25.exe. When I search some text (Ctrl+f) the higlighted found text doesn't appear on the text but a few variable number of caracters before (/after ?). If I use wxPython2.8-win32-ansi-2.8.7.1-py25.exe this problem does not occur. Is there any solution ? Thanks. |
|
From: Werner F. B. <wer...@fr...> - 2008-02-25 15:20:35
|
Hi, le dahut wrote: > Hello, > > I'm using boa-constructor-0.6.1.src.win32.exe on windows xp (sources > installed in C:\python25) with python-2.5.1.msi. > > I use it with wxPython2.8-win32-unicode-2.8.7.1-py25.exe. > > When I search some text (Ctrl+f) the higlighted found text doesn't > appear on the text but a few variable number of caracters before (/after ?). > > If I use wxPython2.8-win32-ansi-2.8.7.1-py25.exe this problem does not > occur. > > Is there any solution ? I am using just about the same (except that I get my boa version always from CVS), i.e. # Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] # wxPython 2.8.7.1, Boa Constructor 0.6.1 # Type "copyright", "credits" or "license" for more information. >>> import wx >>> wx.version() '2.8.7.1 (msw-unicode)' I don't see the problem you are seeing. Is this only happening with particular files? Werner |
|
From: le d. <le....@la...> - 2008-02-25 16:14:50
|
It are normal .py files. I made some tests and it appears if there are some "caractères accentués". If I have : """ coucou psqfqsfq coucou sdfs fsdf sdf sd fcoucou sdfsd sdkj fmqlkj fkqmsj fkq coucou sdfsq éé sdlkfjds fsd sd f q f qf coucou sdfds coucousdfsd """ and I search for "coucou", it is correctly highlighted before the characters "éé". After the blue highlight is 2 characters before where it should be. It seems that the shift corresponds with the number of accentuated characters. I have modified C:\Python25\Lib\site.py line 370 with : encoding = "iso8859-1" Werner F. Bruhin a écrit : > Hi, > > le dahut wrote: >> Hello, >> >> I'm using boa-constructor-0.6.1.src.win32.exe on windows xp (sources >> installed in C:\python25) with python-2.5.1.msi. >> >> I use it with wxPython2.8-win32-unicode-2.8.7.1-py25.exe. >> >> When I search some text (Ctrl+f) the higlighted found text doesn't >> appear on the text but a few variable number of caracters before (/after ?). >> >> If I use wxPython2.8-win32-ansi-2.8.7.1-py25.exe this problem does not >> occur. >> >> Is there any solution ? > I am using just about the same (except that I get my boa version always > from CVS), i.e. > # Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] > # wxPython 2.8.7.1, Boa Constructor 0.6.1 > # Type "copyright", "credits" or "license" for more information. > >>> import wx > >>> wx.version() > '2.8.7.1 (msw-unicode)' > > I don't see the problem you are seeing. > > Is this only happening with particular files? > > Werner > |
|
From: le d. <le....@la...> - 2008-02-26 16:41:26
|
Werner F. Bruhin a écrit :
> Hi,
>
> le dahut wrote:
>> It are normal .py files.
>>
>> I made some tests and it appears if there are some "caractères
>> accentués". If I have :
>> """
>> coucou
>> psqfqsfq
>> coucou
>> sdfs fsdf sdf sd fcoucou sdfsd
>> sdkj fmqlkj fkqmsj fkq coucou sdfsq
>> éé
>> sdlkfjds fsd
>> sd f
>> q
>> f qf coucou
>> sdfds coucousdfsd
>> """
>>
>> and I search for "coucou", it is correctly highlighted before the
>> characters "éé". After the blue highlight is 2 characters before where
>> it should be.
>> It seems that the shift corresponds with the number of accentuated
>> characters.
> Yes, I see this some strange things if the source contains special
> characters, probably some issue with the highlighting causing a problem
> with the unicode escaped character which follows.
>
> Would be interesting to see if other editors which are based on
> wxStyledTextCtrl show the same problem.
>> I have modified C:\Python25\Lib\site.py line 370 with :
>> encoding = "iso8859-1"
> I would suggest to use a sitecustomize.py in your python root folder for
> this, with the following content:
>
> import sys
> sys.setdefaultencoding('utf-8')
Why utf-8 ? windows is iso8859-1 encoded isn't it ?
>
> Werner
>
>
|
|
From: i. s. <ia...@gm...> - 2008-02-26 18:09:09
|
Windows encoding equivalent for iso8859-1 is 'windows-1252', but there are
some (small) differences.
Setting the python encoding to utf-8 should have better results when working
with unicode files. Let us know :-)
2008/2/26, le dahut <le....@la...>:
>
>
> > import sys
> > sys.setdefaultencoding('utf-8')
>
>
> Why utf-8 ? windows is iso8859-1 encoded isn't it ?
>
>
--
- ianaré sévi |
|
From: Werner F. B. <wer...@fr...> - 2008-02-25 19:33:09
|
Hi,
le dahut wrote:
> It are normal .py files.
>
> I made some tests and it appears if there are some "caractères
> accentués". If I have :
> """
> coucou
> psqfqsfq
> coucou
> sdfs fsdf sdf sd fcoucou sdfsd
> sdkj fmqlkj fkqmsj fkq coucou sdfsq
> éé
> sdlkfjds fsd
> sd f
> q
> f qf coucou
> sdfds coucousdfsd
> """
>
> and I search for "coucou", it is correctly highlighted before the
> characters "éé". After the blue highlight is 2 characters before where
> it should be.
> It seems that the shift corresponds with the number of accentuated
> characters.
Yes, I see this some strange things if the source contains special
characters, probably some issue with the highlighting causing a problem
with the unicode escaped character which follows.
Would be interesting to see if other editors which are based on
wxStyledTextCtrl show the same problem.
>
> I have modified C:\Python25\Lib\site.py line 370 with :
> encoding = "iso8859-1"
I would suggest to use a sitecustomize.py in your python root folder for
this, with the following content:
import sys
sys.setdefaultencoding('utf-8')
Werner
|