Hi list,

I noticed that existing Java method that return java.lang.String will auto convert to python unicode string. What happen if I want continue to use the actual java returned type instead of python unicode?

Jython 2.5.2b2 (Release_2_5_2beta2:7124, Sep 14 2010, 00:11:45)
[Java HotSpot(TM) Client VM (Sun Microsystems Inc.)] on java1.6.0_14
Type "help", "copyright", "credits" or "license" for more information.
>>> import java
>>> f = java.io.File("/tmp")
>>> p = f.getName()
>>> type(p)
<type 'unicode'>
>>> bytes = java.lang.String(p).getBytes()

Is there a better way than re-creating another new Java string every time?

Thanks.
Zemian