From: Karen L. <k.l...@qu...> - 2004-07-08 11:11:30
|
My jython code calls a java method which returns a String type attributes.getValue("eorec","") I subsequently want to perform an encode on the returned value like so: endRec.encode("utf-8") However, I receive an error to indicate that the type of what is returned is not of python "string" type and therefore encode is not a possible operation on it: AttributeError: 'None' object has no attribute 'encode' Having looked at the documentation under "Accessing Java from Jython" I would have thought that the coercion from Java type "java.lang.String" to Python type "string" would have been automatic. But this doesn't seem to be happening here. Can anyone explain ? Thanks Karen |