Dear Zemian,

A remark:  I experienced an issue with the File class a few days ago.  Not sure if this is related with your question, anyhow ..

 I've found that the class  works well under Window and Ubuntu, but the class did show up with strange special characters in the file name, like  '?' in place of all the Latin special characters like 'õ' or 'é'.This error happens under the Novell SuSE and  RedHat platform. Apparently, the problem propagates from the base OS platform, possibly some wrong Locale setting, maybe it might be a Java 6 bug. The issue is something specific to Latin
encoded file names, but it might also happen under UTF-8, in other languages like Chinese.

Just wanted to raise this flag.


Claude Falbriard
AMS Hortolândia / SP - Brazil
phone:    +55 13 9762 4094
cell:         +55 13 8117 3316

From: Zemian Deng <>
Date: 19/10/2010 22:06
Subject: [Jython-users] How make java method return java.lang.String?

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 ="/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?

Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
Jython-users mailing list