File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes UTF16 characters not printed properly on console Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "UTF16 characters not printed properly on console" Watch "UTF16 characters not printed properly on console" New topic
Author

UTF16 characters not printed properly on console

jatan bhavsar
Ranch Hand

Joined: Jul 23, 2008
Posts: 297

Hi All,

I have generated UTf16 characters from native2ascii and trying to print that characters in specific language,this is for english. but its dosent give proper output.


it prints þÿServices and sqaure which is not proper .Please any one can guide me how can i achieve this.. I tried with eclipse console encoding as well.

Regards
Jatan
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14487
    
  23

You can only print characters that exist in the font that is being used. If your Windows command prompt uses a font that doesn't contain the characters you want to display, then you get question marks or empty squares instead of the characters. Besides that, I'm not sure if the Windows command prompt has other limitations so that those characters can't be displayed, even if you use a font that has them.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: UTF16 characters not printed properly on console