Issue2128
Created on 2014-04-22.15:00:02 by liucong0311, last changed 2014-07-01.04:04:56 by zyasoft.
msg8296 (view) |
Author: LiuCong (liucong0311) |
Date: 2014-04-22.15:04:01 |
|
java code
class A{
String toString() {
return "哈"
}
}
jython code:(I use PythonInterpreter)
a=A()
print a
when print a java Object, jython cant support unicode, I think this is a bug
PyJavaType code(__repr__ print a string,but this encode by local charset):
addMethod(new PyBuiltinMethodNarrow("__repr__") {
@Override
public PyObject __call__() {
String toString = self.getJavaProxy().toString();
return toString == null ? Py.EmptyString : Py.newString(toString);
}
});
|
msg8692 (view) |
Author: Jim Baker (zyasoft) |
Date: 2014-06-19.00:42:29 |
|
This doesn't really make sense, __str__ is supposed to return a str. Use __unicode__ to return a unicode string.
|
|
Date |
User |
Action |
Args |
2014-07-01 04:04:56 | zyasoft | set | status: pending -> closed |
2014-06-23 18:08:14 | zyasoft | set | status: open -> pending resolution: wont fix |
2014-06-19 00:42:29 | zyasoft | set | messages:
+ msg8692 |
2014-05-21 23:05:35 | zyasoft | set | nosy:
+ zyasoft |
2014-04-22 15:04:01 | liucong0311 | set | messages:
+ msg8296 |
2014-04-22 15:00:02 | liucong0311 | create | |
|