[Soap-Python] Encoding issues on docstrings

Burak Arslan burak.arslan at arskom.com.tr
Wed Nov 21 12:28:59 CET 2012


On 11/21/12 13:18, Thomas AYIH-AKAKPO wrote:
> But actually I was wondering if I could go around this (e.g. not 
> explicitly mention u"""<docstring>""") without modifying the source 
> code on my installation as I did.

You shouldn't. To understand what encoding a str docstring has, one has 
to parse the source file and find the # encoding: blah line to .decode() 
the str to unicode.

You can try it yourself:

#encoding: utf8
print len("ü") # 2
print len(u"ü") # 1

#encoding: iso8859-9
print len("ü") # 1
print len(u"ü") # 1

you must make sure to save the files in noted encodings or use iconv to 
convert them to get the same result.

Best,
Burak



More information about the Soap mailing list