I'm working on the feature that was mentioned yesterday about allowing the applicaiton to set which encoding wxPython will use when converting Python string/unicode objects to and from wxStrings, instead of just using the Python default encoding. So far it is working fine, I just have one question for the group: What should the default setting be?
Currently I have the default set to the value of locale.getdefaultlocale()[1], but that could return a platform specific locale. For example, I get the following:
linux: iso-8859-1
windows: cp1252
osx: mac-roman
Those are all supposed to be nearly equivallent, and my tests work okay so far on each, but the "nearly" worries me a bit that there may be subtle differences in a single app when run on the different platforms. Should I just hard-code the default to "ascii" (backwards compatible) or perhaps "iso-8859-1" (mostly compatible but more intuitive based on messages from the mail lists) ??
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
I'm working on the feature that was mentioned yesterday about allowing the applicaiton to set which encoding wxPython will use when converting Python string/unicode objects to and from wxStrings, instead of just using the Python default encoding. So far it is working fine, I just have one question for the group: What should the default setting be?
Currently I have the default set to the value of locale.getdefaultlocale()[1], but that could return a platform specific locale. For example, I get the following:
linux: iso-8859-1
windows: cp1252
osx: mac-roman
Those are all supposed to be nearly equivallent,
Hmm... Looking at the the modules in the encodings package for these shows that they really are not even nearly equivallent, not sure where I got the impression that they were.
The question still stands though. Should wxPython's default be the default locale's encoding or should it be a value that is the same on all platforms and doesn't take the default locale into account?
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
Hi,
I'm working on the feature that was mentioned yesterday about allowing the applicaiton to set which encoding wxPython will use when converting Python string/unicode objects to and from wxStrings, instead of just using the Python default encoding. So far it is working fine, I just have one question for the group: What should the default setting be?
Currently I have the default set to the value of locale.getdefaultlocale()[1], but that could return a platform specific locale. For example, I get the following:
linux: iso-8859-1
windows: cp1252
osx: mac-roman
Those are all supposed to be nearly equivallent,
Hmm... Looking at the the modules in the encodings package for these shows that they really are not even nearly equivallent, not sure where I got the impression that they were.
The question still stands though. Should wxPython's default be the default locale's encoding or should it be a value that is the same on all platforms and doesn't take the default locale into account?
I really think it should be the default locale's encoding. If we can't do that reliably, then it should just revert to default Python behavior - ascii. As you noted, the various platform encodings aren't equivalent, but at the same time, basic tests probably won't make this clear. So I think it's better to have a default that will clearly cause problems when it's not the right choice rather than one that may subtly cause them.
Just my $0.02.
Thanks,
Kevin
···
On Dec 15, 2004, at 1:56 PM, Robin Dunn wrote:
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-dev-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-dev-help@lists.wxwidgets.org
there are A LOT of differences between the 3 (all above 128 tho):
my take on this is that it should be using ISO-8859-1 as this is closer to unicode which should be, in my view, recommended.
ISO-8859-1 should be used in all platforms and in non-unicode builds there should probably be one very big red blinking text warning about special characters.
just my 0.02€ :o)
···
On Wed, 15 Dec 2004 15:40:50 -0800, Kevin Ollivier <kevino@tulane.edu> wrote:
Hi Robin,
On Dec 15, 2004, at 1:56 PM, Robin Dunn wrote:
Robin Dunn wrote:
Hi,
I'm working on the feature that was mentioned yesterday about
allowing the applicaiton to set which encoding wxPython will use when
converting Python string/unicode objects to and from wxStrings,
instead of just using the Python default encoding. So far it is
working fine, I just have one question for the group: What should
the default setting be?
Currently I have the default set to the value of
locale.getdefaultlocale()[1], but that could return a platform
specific locale. For example, I get the following:
linux: iso-8859-1
windows: cp1252
osx: mac-roman
Those are all supposed to be nearly equivallent,
Hmm... Looking at the the modules in the encodings package for these
shows that they really are not even nearly equivallent, not sure where
I got the impression that they were.
The question still stands though. Should wxPython's default be the
default locale's encoding or should it be a value that is the same on
all platforms and doesn't take the default locale into account?
I really think it should be the default locale's encoding. If we can't
do that reliably, then it should just revert to default Python behavior
- ascii. As you noted, the various platform encodings aren't
equivalent, but at the same time, basic tests probably won't make this
clear. So I think it's better to have a default that will clearly cause
problems when it's not the right choice rather than one that may subtly
cause them.
I'm working on the feature that was mentioned yesterday about allowing the applicaiton to set which encoding wxPython will use when converting Python string/unicode objects to and from wxStrings, instead of just using the Python default encoding. So far it is working fine, I just have one question for the group: What should the default setting be?
Currently I have the default set to the value of locale.getdefaultlocale()[1], but that could return a platform specific locale. For example, I get the following:
linux: iso-8859-1
windows: cp1252
osx: mac-roman
IMO windows: mbcs,ignore is the best choice. ctypes already uses this.