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  java.io.File  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.

Regards,
Claude

Claude Falbriard
Developer
AMS Hortolândia / SP - Brazil
phone:    +55 13 9762 4094
cell:         +55 13 8117 3316
e-mail:    claudef@br.ibm.com



From: Zemian Deng <saltnlight5@gmail.com>
To: jython-users@lists.sourceforge.net
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 = 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
------------------------------------------------------------------------------
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!
http://p.sf.net/sfu/adobe-dev2dev_______________________________________________
Jython-users mailing list
Jython-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users