Hello-
A thread on wxpython-users evolved into a topic that should
be better placed here, so here it is:
In
http://lists.wxwidgets.org/cgi-bin/ezmlm-cgi?11:msp:26378:hgfembmeaehpeh
kpkcpi
I noted that (Chinese GB) text was being inaccurately converted to
unicode by
wxTextDataObject. Robin's response is here:
http://lists.wxwidgets.org/cgi-bin/ezmlm-cgi?11:mss:26378:hgfembmeaehpeh
kpkcpi
To get around this problem, it would be good to have a wxTextDataObject:
a) by default, convert to unicode from locale/encoding of program; or
b) allow programmer/user to specify a different encoding to
convert from (one might copy/paste different languages); or
c) allow programmer to specify a function to use for conversion.
It would probably be better to use python's unicode() function than
wxWidgets functions, since the python codecs would likely cover
more languages and be kept more current.
This way, only a unicode string (and not a unicode and native format
string)
would need to be stored by wxTextDataObject and the programmer could
still enable the program to function even if there isn't a codec for
his/her
language.
Unfortunately, I can still think of one problem: a programmer/user
might
have a need for the original, unconverted text. Would it be possible
for
there to be a parameter called by __init__ that specifies 'unicode'
(default)
or 'raw_str'? Perhaps this should have a corresponding function, so
that
a programmer could allow a user to select 'unicode' or 'raw_str'.
On the other hand, perhaps simply storing both unicode and the original
is easiest to develop (although suggestions a,b,c would still be useful
in this case.)
Thanks,
John