Re: [Pyobjc-dev] depythonify_c_value rejects non-ascii, non-unicode strings
Brought to you by:
ronaldoussoren
From: Ronald O. <ous...@ci...> - 2004-01-21 17:38:08
|
On 21 jan 2004, at 18:20, Marc-Antoine Parent wrote: [...] > So let me then make a plea for an API so that a PyObjC program can > tell the bridge to use an encoding other than the system default, if > specified, even if the default behaviour remains identical, i.e. throw > exceptions upon non-ascii strings. I don't like introducing global switches like this, libraries may modify the switch and change the behaviour of other code. Too bad that sitecustomize.py cannot in the same directory as a script (dirname(sys.argv[0] is added after site.py finishes). BTW. does anyone know why sys.setdefaultencoding is removed in site.py? E.g. why is it good that users cannot change the default encoding after the interpreter has initialized? > That way, only a program that knows what it is doing will modify the > behaviour, and no data will be lost by default; but a program that has > good architectural reasons to do so might still use another encoding > internally. Unicode should be good enough for this. The strings used by Cocoa are Unicode strings there's not much you can do about this. Ronald |