aspose file tools*
The moose likes Beginning Java and the fly likes simple code ! char conversion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "simple code ! char conversion" Watch "simple code ! char conversion" New topic
Author

simple code ! char conversion

ram kumar
Ranch Hand

Joined: May 22, 2008
Posts: 146



Output : 1

unicodeValue in integer = 240
unicodevalue in char =


This is said to be Latin-1 format.


when i run the same code, in Unix machine.

i get the output as



Output : 2

unicodeValue in integer = 240
unicodevalue in char = ��


I dont know what format it is ?

I think it is UTF-8.

I want the second output.

when i run this code in the windows machine itself.

How can i convert that.

Some OnePlease Help !
[ September 26, 2008: Message edited by: ram kumar ]

Discussion - the powerfull way to excellence!
Gamini Sirisena
Ranch Hand

Joined: Aug 05, 2008
Posts: 347
Output 1 is from windows console?
Output 2 is from Unix console?
ram kumar
Ranch Hand

Joined: May 22, 2008
Posts: 146
Originally posted by Gamini Sirisena:
Output 1 is from windows console?
Output 2 is from Unix console?



Output 1 is from windows console? YES !
Output 2 is from Unix console? YES !
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

You might find that you need to change the locale that your console is outputting in (I've run across a similar problem recently with Japanese characters).

In Linux I set my LANG variable to be Japanese UTF-8 to see the correct characters coming out.
[ September 26, 2008: Message edited by: Martijn Verburg ]

Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
ram kumar
Ranch Hand

Joined: May 22, 2008
Posts: 146
Originally posted by Martijn Verburg:
You might find that you need to change the locale that your console is outputting in (I've run across a similar problem recently with Japanese characters).

In Linux I set my LANG variable to be Japanese UTF-8 to see the correct characters coming out.

[ September 26, 2008: Message edited by: Martijn Verburg ]



How to set my Locale in Windows ! using version java 1.2 !
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Have a look at your language settings in the control panel, IIRC you can change things there.
ram kumar
Ranch Hand

Joined: May 22, 2008
Posts: 146
Originally posted by Martijn Verburg:
Have a look at your language settings in the control panel, IIRC you can change things there.


May Be ! But that too is help less ! I tried !

Am using Eclipse IDE 3.2.1, still facing the same problem !

I am clearly sure that output - 1 as i said is the character from latin -1

and output - 2 is the exact UTF - 8 that am looking for !
ram kumar
Ranch Hand

Joined: May 22, 2008
Posts: 146
Originally posted by Gamini Sirisena:
Output 1 is from windows console?
Output 2 is from Unix console?



What shall be done !

Am using Eclipse 3.2.1 / WINXP / jdk 1.4 / jre 1.6.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: simple code ! char conversion