unicode encoding usablilty problem

Jarek Zgoda jzgoda at gazeta.usun.pl
Fri Feb 18 15:13:11 EST 2005


Fredrik Lundh napisał(a):

>>This brings up another issue. Most references and books focus exclusive on  entering unicode 
>>literal and using the encode/decode methods. The fallacy  is that string is such a basic data type 
>>use throughout the program, you  really don't want to make a individual decision everytime when 
>>you use  string (and take a penalty for any negligence). The Java has a much more  usable model 
>>with unicode used internally and encoding/decoding decision  only need twice when dealing with 
>>input and output.
> 
> that's how you should do things in Python too, of course.  a unicode string
> uses unicode internally. decode on the way in, encode on the way out, and
> things just work.

There are implementations of Python where it isn't so easy, Python for 
iSeries (http://www.iseriespython.com/) is one of them. The code written 
for "normal" platform doesn't work on AS/400, even if all strings used 
internally are unicode objects, also unicode literals don't work as 
expected.

Of course, this is implementation fault but this makes a headache if you 
need to write portable code.

-- 
Jarek Zgoda
http://jpa.berlios.de/ | http://www.zgodowie.org/



More information about the Python-list mailing list