Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

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: 69429
276
  • 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: 25594
69
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.)
 
What are your superhero powers? Go ahead and try them on this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic