Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Chceking the value of a Character

807603Jan 30 2008 — edited Jan 30 2008
Good Afternoon All,

I have a piece of code that is reading an Excel file and converting it into XML. In the source data in Excel I have characters that are not valid in the XML (for example, craracters with accent marks).

On this forum I found the code example below,but I am confused by it. In the example below "current" is compared to 0xA. I am not sure that I understand what 0xA is. I though that is was the hex value of decimal 10 when whoud be a new line in Ascii. When looking at the rest of the code I get confused because 0x10FFFF would be decimal 1,114,111 and I have no clue what that would be in Ascii.

If I just wanted letters, numbers, and the characters like (){}./// would the code be
(current >= 0x30) && (current <= 0x7e)
Thanks for your help!
Doug

(current is a character)
if ((current == 0x9) ||
                (current == 0xA) ||
                (current == 0xD) ||
                ((current >= 0x20) && (current <= 0xD7FF)) ||
                ((current >= 0xE000) && (current <= 0xFFFD)) ||
                ((current >= 0x10000) && (current <= 0x10FFFF)))
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 27 2008
Added on Jan 30 2008
10 comments
490 views