aspose file tools*
The moose likes Java in General and the fly likes Ascii character Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Ascii character " Watch "Ascii character " New topic
Author

Ascii character

Dillibabu Balakrishnan
Greenhorn

Joined: Sep 11, 2012
Posts: 8
hi all,
How do i display ascii character from 0 to 255 in java
(from 0 to 127 no problem,from 128 to 255 it is displaying ? mark)

Thanks and Regards
Dillibabu.B
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39791
    
  28
Welcome to the Ranch
128…255 are not ASCII characters. I suggest you read about the history of character encoding here.
Java can display any Unicode character, but not every platform can. The Windows® command line is notorious for its inability to display characters. Rather than using System.out.println, try a Java applicatoin, eg JOptionPane.showMessageDialog(null, "™ˆª");
Dillibabu Balakrishnan
Greenhorn

Joined: Sep 11, 2012
Posts: 8
Hi Campbell Ritchie,
Thanks for reply my post
i agreed that from 128 to 255 is not ascii character but it is extended ascii character know then how do i display that character in java

Regards
Dillibabu.B
Vishal Shaw
Ranch Hand

Joined: Aug 09, 2012
Posts: 179
Hi,

Basically, The characters (with ASCII>=128)that you want to display, will display to an outputstream that has been encoded properly.

Unfortunately in this case the PrintStream is not encoded with the necessary encoding.
You can try encoding your PrintStream.
Or,you can try outputing the characters to a File (FileStream) and encode it with UTF-8.


Programming is about thinking, NOT coding
Vishal Shaw
Ranch Hand

Joined: Aug 09, 2012
Posts: 179
You can also check out this sample program
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39791
    
  28
Dillibabu Balakrishnan wrote: . . . then how do i display that character in java

Regards
Dillibabu.B
I have already given you one way to do it.
Gihan Pandigamage
Ranch Hand

Joined: Aug 23, 2009
Posts: 60
try this

Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 8196
    
  23

Dillibabu Balakrishnan wrote:i agreed that from 128 to 255 is not ascii character but it is extended ascii character...

No it ISN'T. I suggest you read Campbell's link before making statements like that.

Winston


Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Ascii character