Message8473
This is an unfortunate aspect of Python's str/unicode distinction. Jython used to ignore this distinction, but it caused significant incompatibility with running standard Python code.
The fact that you can construct bytestrings out of UTF-8 sequences in this way is very much orthogonal; I should also point out that the console is a bit problematic here (https://wiki.python.org/jython/ConsoleChoices). I will stick with scripts:
# -*- coding: utf-8 -*-
val = u"schön"
print val
Does print out what we expect:
$ jython27 test_utf8.py
schön
So please use unicode for unicode strings, str (or bytes) for byte strings.
Jython 3.x will make this work much better by making the usual string type be unicode, which will align better with Java usage, but that's very much vaporware for now. |
|
Date |
User |
Action |
Args |
2014-05-21 21:16:02 | zyasoft | set | messageid: <1400706962.09.0.224685346843.issue2073@psf.upfronthosting.co.za> |
2014-05-21 21:16:02 | zyasoft | set | recipients:
+ zyasoft, santa4nt, omatz |
2014-05-21 21:16:02 | zyasoft | link | issue2073 messages |
2014-05-21 21:16:01 | zyasoft | create | |
|