• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Chinese (Unicode) issue in Windows command Prompt

 
Greenhorn
Posts: 3
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

i am working on Chinese language issue,

In English OS when i try to print the Chinese characters in Windows command prompt, It does not support instead of it printing "???"

In Chinese OS It displays correctly.

please give me some ideas to clear this issue.

The following scenarios i have tested,

1. Installed the Language pack for chinese language.
2. Writing the Chinese characters using the printStream
3. Decoded to UTF8 Characters
4. Changing the System locales in control panel


But it does not helped me lot.


Thanks in Advance.

Udhay
 
Marshal
Posts: 64707
226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think this question might fit better elsewhere, so I shall duplicate it.

I Googled and found this; I haven't tried it so I don't know whether it works, but it looks promising.
 
Bartender
Posts: 3648
16
Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First off the English Windows OS does not come with East Asian (Chinese, Japanese, Korean) fonts. Installing that font pack may help.

Another issue does Windows command prompt support UTF8 for English OS? Can the command prompt specify what font it can use?

If you run the program inside an IDE, the font should display without problem.
 
Marshal
Posts: 24594
55
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the Windows shell, it's the "Code Page" which determines how bytes are converted to glyphs on the screen. You can use the CHCP command to change your shell's code page and to determine what it is.

So: In your Chinese Windows, use CHCP to find out what code page it's using. Then in your other-place Windows, use CHCP to change the code page to that code page before you run your application. (It may be the case that your other-place Windows doesn't support that code page, and you might have to install something to make it change its mind about that.)
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!