Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

simple code ! char conversion

 
ram kumar
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



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 ]
 
Gamini Sirisena
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Output 1 is from windows console?
Output 2 is from Unix console?
 
ram kumar
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
ram kumar
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at your language settings in the control panel, IIRC you can change things there.
 
ram kumar
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic