Originally posted by Suresh Kanagalingam:
Hi Paul,
I checked the program to make sure it is writing standard character set to the file. I even used TextPad to type French characters using TextPad "ANSI Character" listing.
Can you please confirm that for letter "�" to be validated with UTF-8, it has to have hex value of 201?
Thanks
Suresh
To reiterate what Reid said, if you're seeing a hex value of 201 in your file then it isn't encoded in UTF-8. And if you used the "standard character set" to write to the file, that almost certainly wouldn't be UTF-8 anyway.
The easiest way to get your XML encoding right in
Java is to use the standard XML software (whatever's built in to your JRE, or Xerces or Xalan or Saxon or some other open-source product) and to provide an output stream (not a Writer) for it to write to. The software will take care of the encoding.
Or iff you're writing XML to a file with your own ad-hoc code, then encode it in UTF-8 like this: