Content-type: multipart/alternative; Boundary="1__=C7BBF304DF98F79F8f9e8a93df938690918cC7BBF304DF98F79F" --1__=C7BBF304DF98F79F8f9e8a93df938690918cC7BBF304DF98F79F Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: quoted-printable Thanks Chris, I'll have a try. Best Regards -------------------- Sean = Chris Clark = = To jython-users@lists.sourceforge.n= et 2012-02-01 00:51 = cc = Subj= ect Re: [Jython-users] I can only in= put a character with = java.lang.System.console().readl= ine () in Chinese or Japanese langua= ge = = = = = = The screen shot (rather than a copy/paste) was very useful. The good news is that I know what you want/are trying to do. You want to use the Microsoft CMD window to run console Jython scripts with a Chinese locale (cp936, see http://msdn.microsoft.com/en-us/library/windows/desktop/dd317756%28v=3D= vs.85%29.aspx and http://en.wikipedia.org/wiki/Code_page_936 ). The bad news is that it is not possible. The Microsoft CMD does NOT support UTF8, you simply can't use utf8 reliably in a CMD window. You really want cp936 support (to match the desktop locale settings) but Jython does NOT support CJK either (http://www.jython.org/faq3.html claims it would but it was not implemented, see http://bugs.jython.org/issue1066 for more info, the good news is that a= future release should have something). I did knock up an NIO based codec (very simply it worked fine for Japanese, it would take 2 mins to make a cp936 one), there was no interest at the time, see http://article.gmane.org/gmane.comp.lang.jython.user/8665/match=3Djytho= n +2.5.1+various+encodings+support+lookuperror+unknown The options as I see it are: * set the encoding to cp936 (which is what your desktop is using), an= d create a cp936 codec (based on my nio encoding experiment or some other mechanism, see last two options) * use jythonconsole (it looks cool, I've not had chance to play with it yet) with utf8, http://code.google.com/p/jythonconsole/ * use mintty, I've had mixed success (things work but CTRL-C behavior= is odd) using this with utf8 applications under windows but I've no= t tried jython/java apps http://code.google.com/p/mintty/ * pay someone to add CJK support to the version of Jython you are usi= ng * add CJK support yourself to the version of Jython you are using Chris On 1/31/2012 2:48 AM, Sheng Qiang Xu wrote: > > Philip, > > Thanks for your reply. > I tried to force the encoding, but not work yet. > Here is what I tried. My OS Locale is Chinese. Before I forced the > encoding value, it is already utf-8. > > > Best Regards > -------------------- > Sean > > Inactive hide details for Philip Jenvey ---2012-01-31 11:47:30---On > Jan 17, 2012, at 7:17 PM, Sheng Qiang Xu wrote:Philip Jenvey > ---2012-01-31 11:47:30---On Jan 17, 2012, at 7:17 PM, Sheng Qiang Xu > wrote: > > *Philip Jenvey * > > 2012-01-31 11:47 > > > > To > > Sheng Qiang Xu/China/IBM@IBMCN > > cc > > jython-users users > > Subject > > Re: [Jython-users] I can only input a character with > java.lang.System.console().readline() in Chinese or Japanese language= > > > > > > On Jan 17, 2012, at 7:17 PM, Sheng Qiang Xu wrote: > > > I'm using jython 2.5.1 and my OS is windows XP and language is Chin= ese. > > > > When using java.lang.System.console().readline() to input text, I > can only input a character (the behavior seems like pressing enter) > and the console jumps to next line. > > > > Could somebody pls help to take a look at this? > > Thanks. > > You probably have an incorrect input encoding value set on your platf= orm. > > You can see what Jython uses for its input encoding by looking at the= > value of sys.stdin.encoding. You can try forcing it to say UTF-8 by > passing "-Dpython.console.encoding=3DUTF-8" to Jython > > -- > Philip Jenvey > -----------------------------------------------------------------------= ------- Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers= is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3= , Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d _______________________________________________ Jython-users mailing list Jython-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jython-users = --1__=C7BBF304DF98F79F8f9e8a93df938690918cC7BBF304DF98F79F Content-type: text/html; charset=US-ASCII Content-Disposition: inline Content-transfer-encoding: quoted-printable

Thanks Chris, I'll have a try.

Best Regards
--------------------
Sean

3D"InactiveChris Clark ---2012-= 02-01 00:52:35---The screen shot (rather than a copy/paste) was very us= eful. The good

=
          Chris Clark <Chris.Clark@actian.com>

          2012-02-01 00:51

=
3D=
To
3D""
jython-users@lists.sourceforge.net
3D=
cc
3D""
3D=
Subject
3D""
Re: [Jython-users] I can only input a character with j= ava.lang.System.console().readline() in Chinese or Japanese language
3D=3D""

The screen shot (rather than a copy/paste) was very useful. The goo= d
news is that I know what you want/are trying to do.

You want to use the Microsoft CMD window to run console Jython scripts =
with a Chinese locale (cp936, see
http://msdn.microsoft.com/en-us/libr= ary/windows/desktop/dd317756%28v=3Dvs.85%29.aspx 
= and
htt= p://en.wikipedia.org/wiki/Code_page_936 ).


The bad news is that it is not possible. The Microsoft CMD does NOT support UTF8, you simply can't use utf8 reliably in a CMD window. You <= br> really want cp936 support (to match the desktop locale settings) but Jython does NOT support CJK either (
http://www.jython.org/faq3.html  claims it would but it was not implemented, see
http://bugs.jytho= n.org/issue1066 for more info, the good news is that = a
future release should have something).

I did knock up an NIO based codec (very simply it worked fine for
Japanese, it would take 2 mins to make a cp936 one), there was no
interest at the time, see
http://article.gmane.org/gmane.comp.lang.jython.user/8665/match=3Dj= ython+2.5.1+various+encodings+support+lookuperror+unknown<= br>

The options as I see it are:

 * set the encoding to cp936 (which is what your desktop is using= ), and
   create a cp936 codec (based on my nio encoding experiment= or some
   other mechanism, see last two options)
 * use jythonconsole (it looks cool, I've not had chance to play = with
   it yet) with utf8,
http://code.google.com/p/jythonconsole/=
 * use mintty, I've had mixed success (things work but CTRL-C beh= avior
   is odd) using this with utf8 applications under windows b= ut I've not
   tried jython/java apps
http://code.google.com/p/mintty/
 * pay someone to add CJK support to the version of Jython you ar= e using
 * add CJK support yourself to the version of Jython you are usin= g


Chris


On 1/31/2012 2:48 AM, Sheng Qiang Xu wrote:
>
> Philip,
>
> Thanks for your reply.
> I tried to force the encoding, but not work yet.
> Here is what I tried. My OS Locale is Chinese. Before I forced the=
> encoding value, it is already utf-8.
>
>
> Best Regards
> --------------------
> Sean
>
> Inactive hide details for Philip Jenvey ---2012-01-31 11:47:30---O= n
> Jan 17, 2012, at 7:17 PM, Sheng Qiang Xu wrote:Philip Jenvey
> ---2012-01-31 11:47:30---On Jan 17, 2012, at 7:17 PM, Sheng Qiang = Xu
> wrote:
>
>                 *Philip Je= nvey <pjenvey@underboss.org>*
>
>                 2012-01-31= 11:47
>
>
>
> To
>
> Sheng Qiang Xu/China/IBM@IBMCN
>
> cc
>
> jython-users users <jython-users@lists.sourceforge.net>
>
> Subject
>
> Re: [Jython-users] I can only input a character with
> java.lang.System.console().readline() in Chinese or Japanese langu= age
>
>
>
>
>
> On Jan 17, 2012, at 7:17 PM, Sheng Qiang Xu wrote:
>
> > I'm using jython 2.5.1 and my OS is windows XP and language i= s Chinese.
> >
> > When using java.lang.System.console().readline() to input tex= t, I
> can only input a character (the behavior seems like pressing enter= )
> and the console jumps to next line.
> >
> > Could somebody pls help to take a look at this?
> > Thanks.
>
> You probably have an incorrect input encoding value set on your pl= atform.
>
> You can see what Jython uses for its input encoding by looking at = the
> value of sys.stdin.encoding. You can try forcing it to say UTF-8 b= y
> passing "-Dpython.console.encoding=3DUTF-8" to Jython >
> --
> Philip Jenvey
>


-----------------------------------------------------------------------= -------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers=
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3= ,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.ne= t/sfu/learndevnow-d2d
_______________________________________________
Jython-users mailing list
Jython-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users


= --1__=C7BBF304DF98F79F8f9e8a93df938690918cC7BBF304DF98F79F--