Duncan Booth wrote: > hg <[EMAIL PROTECTED]> wrote: > >>> or in other words, put this at the top of your file (where "utf-8" is >>> whatever your editor/system is using): >>> >>> # -*- coding: utf-8 -*- >>> >>> and use >>> >>> u'<text>' >>> >>> for all non-ASCII literals. >>> >>> </F> >>> >> Hi, >> >> The problem is that: >> >> # -*- coding: utf-8 -*- >> import string >> print len('a') >> print len('à') >> >> returns 1 then 2 > > And if you do what was suggested and write: > > # -*- coding: utf-8 -*- > import string > print len(u'a') > print len(u'à') > > then you get: > > 1 > 1 OK,
How would you handle the string.maketrans then ? hg -- http://mail.python.org/mailman/listinfo/python-list