How to view non-English text in a table

degoor_widgets@dir.bg wrote:

Hi friends,

For those of you that have to write or use non-English alphabet it's
common to write something in their own language (e.g. in a GUI app
static text box) and just after that to see the same text coverted

to

'\xcf\xd4\xde\xce...' or something of the kind. In most cases that

is

not a problem - when the frame is displayed you can see the original
text even though Pythos stores it as '\x....\x...\x...\x'.

It doesn't actually get stored in that format, that is just how Python

represents the bytes of the string that it doesn't know how to print
(unless you are explicitly converting to the string repr format

someplace.)

So here comes my question: I am using Boa Constrauctor 0.4.0 +Python
2.4.1+ wxPython 2.5.5.1 on os Win98 SE for creating user interfce of
Firebird database . For visualization of the data in the base on
computer screen I tried to use wxGrid that could arrange the data in
something like a spreadsheet table. But when I tried to use
wxGrid::SetCellValue (row, col, string), instead of the orirginal

text

(in my case Bulgarian -cyrillic- text), in the cell I saw
'\xcf\xd4\xde\xce...' . So that's the problem.

Take a hard look at the string. Does it contain the

Bulgarian-cyrillic

text or does it contain a '\' character followed by a 'x' and 'c' and
'f'... ?

Dear Robin,

I believe all of the '\x....\x...\x...\x' represent 2-digit hex numbers
preceded with
backslashes - the number of these 2-digit hex-s is equal to the number
of the
cyrillic letters in the string. On a command prompt:

(com_prompt)>>> a = '-some cyrillic text-'
(com_prompt)>>> print a
(com_prompt)- cyrilic text printed ok -
(com_prompt)>>> a
(com_prompt)'\x....\x...\x...\x'

In my code using wxGrid I have this command line:

--- 'self.grid1' created as wxGrid ---
self.grid1.SetCellValue(num_row, num_col, a)

(wxPython manual sais that 'a' should be a string)

When I have the code executed, in the cell (num_row, num_col) instead
of readable
cyrillic text I get '\x....\x...\x...\x'. If I could use 'print ' with
'SetCellVallue' it'd be ok but since
AFAIK that can not be done I am looking for some other way to do it.

Yours,
degoor

degoor_widgets@dir.bg wrote:

Dear Robin,

I believe all of the '\x....\x...\x...\x' represent 2-digit hex numbers
preceded with backslashes - the number of these 2-digit hex-s is equal to the number
of the
cyrillic letters in the string. On a command prompt:

(com_prompt)>>> a = '-some cyrillic text-'
(com_prompt)>>> print a
(com_prompt)- cyrilic text printed ok -
(com_prompt)>>> a
(com_prompt)'\x....\x...\x...\x'

In my code using wxGrid I have this command line:

--- 'self.grid1' created as wxGrid ---
self.grid1.SetCellValue(num_row, num_col, a)

(wxPython manual sais that 'a' should be a string)

When I have the code executed, in the cell (num_row, num_col) instead
of readable
cyrillic text I get '\x....\x...\x...\x'. If I could use 'print ' with
'SetCellVallue' it'd be ok but since
AFAIK that can not be done I am looking for some other way to do it.

Please send a small sample application that shows the problem.

ยทยทยท

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!