• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

chinese character in eclipse

 
Ranch Hand
Posts: 348
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In my app, I want to handle chinese names written both in chinese characters and its latin version (normal english alphabet like Li Na). what do I need to do? I've set my console and editor encoding to UTF-8, but still no luck. Do i need to install the language pack from windows CD?
thanks
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not having a problem. I put some Chinese characters into my code (via the Windows Character Map) and they show up on the Eclipse console just fine when I use System.out.println on them.

But then you didn't exactly say what your problem was. Perhaps your application is a Swing application and displays Chinese characters as boxes? Perhaps it's a web app and it butchers them so you see € and ™ and such junk instead? Perhaps you're having trouble entering them via the keyboard?
 
Marshal
Posts: 4499
572
VSCode Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just tried on Windows 7 and Eclipse console output and SWING seems to work without doing anything special.



Sorry Paul - didn't see that you already replied about Eclipse.
 
David Spades
Ranch Hand
Posts: 348
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
no, it's just a simple console application. Just a standard test app with one main function. So, I googled some random website written in chinese character, copy one chinese character from it and pasted it in my



but when I pasted it in, I got weird block character instead of the chinese character.
 
Paul Clapham
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Usually seeing a rectangle in place of some character means you're using a font which can't render that character. So check your font.
 
David Spades
Ranch Hand
Posts: 348
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what should I change my font to? thanks
 
Paul Clapham
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

David Spades wrote:what should I change my font to? thanks



Something which supports Chinese characters, of course!

Fonts whose names contain the word "Unicode" are good candidates, for example. But if you want to write some code which reviews all your available fonts: The Font class has a canDisplay(char) method which tells you whether it can render a particular character. And the GraphicsEnvironment class has a getAllFonts() which does what you might think it does.
 
David Spades
Ranch Hand
Posts: 348
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
there's only one font in eclipse that contains "unicode" in it which is Lucida Sans Unicode. still didn't work. am I missing anything here? thanks
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic