Issue1183
Created on 2008-11-24.22:47:07 by rose.pan, last changed 2009-06-21.21:52:40 by pjenvey.
msg3846 (view) |
Author: (rose.pan) |
Date: 2008-11-24.22:47:06 |
|
Jython 2.2.1 cannot pass a unicode String to a function defined in a py
script as a parameter. The value of the parameter is converted to
different \x format. This is not happened in Jython 2.1.
To reproduce it, define a py script, test.py file. The test.py file
defines a function called create() which simply returns the value of the
parameter:
======= start of test.py ======
def create(name):
return name
======= end of test.py =====
Then start Jython 2.1 and run the function create() from the py file:
java -classpath jython.jar.2.1 org.python.util.jython
Jython 2.1 on java1.6.0_05 (JIT: null)
>>> execfile("test.py")
>>> create('\u4f7f\u7528') <-- input Japanese characters
u'\u4F7F\u7528' <-- return the same unicode representing the
Japanese characters with length 2
>>>
We can see the output of create function returns a two-byte unicode.
Then we try Jython 2.2.1 with the same step:
java -classpath jython.jar.2.2.1 org.python.util.jython
Jython 2.2.1 on java1.6.0_05
>>> execfile("test.py")
>>> create('\u4f7f\u7528') <-- input Japanese characters
'\xBB\xC8\xCD\xD1' <-- returns different values with length 4.
This is a regression for Jython 2.2.1.
|
msg4835 (view) |
Author: Philip Jenvey (pjenvey) |
Date: 2009-06-21.21:52:40 |
|
fixed in 2.5
|
|
Date |
User |
Action |
Args |
2009-06-21 21:52:40 | pjenvey | set | status: open -> closed resolution: fixed messages:
+ msg4835 nosy:
+ pjenvey |
2009-03-14 02:32:57 | fwierzbicki | set | priority: normal |
2008-11-24 22:47:07 | rose.pan | create | |
|