String encoding problem in frozen application
Gordon McMillan
gmcm at hypernet.com
Tue Jan 22 17:13:35 EST 2002
Martin von Loewis wrote:
> Gordon McMillan <gmcm at hypernet.com> writes:
>
>> The problem is that the import of the encoding is implicit.
>> As a red-blooded American, I have luxuriated in my ignorance
>> of all unicode issues, but I guess I'll have to figure out what
>> triggers that bit of magic.
>
> Somebody invoking .encode() on an string is a good indication, or
> invoking unicode(). In either case, you may consider the string
> literal as an indication what codecs are needed. If there is no string
> argument, all guesses are open what codecs will be needed.
Well, 2.2's Tools/freeze doesn't look for either of those,
so I'd guess freeze has the same problem. A LOAD_GLOBAL of 'unicode'
shouldn't be too hard to scan for, but LOAD_ATTR 'encode' is
definitely a rat's nest.
Add to that the problem of what the target user's locale might
be, and I doubt there's much hope for being selective about
the encodings.
-- Gordon
http://wwww.mcmillan-inc.com/
More information about the Python-list
mailing list