aspose file tools*
The moose likes Beginning Java and the fly likes create char using unicode value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "create char using unicode value" Watch "create char using unicode value" New topic
Author

create char using unicode value

Stephen Huey
Ranch Hand

Joined: Jul 15, 2003
Posts: 618
Ok, I know this should be super basic, but I've Googled it and found this helpful webpage that provided a workaround--I just copy the char and paste it into my code. However, it would still be nice to know how to construct the following character knowing that the unicode value is 253:

I appreciate your help,
Stephen
Jeff Bosch
Ranch Hand

Joined: Jul 30, 2003
Posts: 804
char funnyY = '\U0253';
But, you need a Unicode-savvy viewer to see the actual character.
Regards,
Jeff


Give a man a fish, he'll eat for one day. Teach a man to fish, he'll drink all your beer.
Cheers, Jeff (SCJP 1.4, SCJD in progress, if you can call that progress...)
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
Remeber, the Unicode values for \u are Hex Based. This would actually be
'\u00DD'
Also, since char is a number primative you can set it with number.
char crazyY = 253;
Since you set it with a literal, no cast is required.


I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
Jeff Bosch
Ranch Hand

Joined: Jul 30, 2003
Posts: 804
I assumed, because the value was called "Unicode value 253", that 253 was hex. I probably should have confirmed the value against the Unicode character set, eh?
Regards,
Jeff
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: create char using unicode value