Problem with Latin character using JavaDocx
I just got JavaDocx free library two days ag开发者_运维问答o. I'm trying to generate a file which has to contain Latin characters as ó, ú, etc. When I try to open the generated file, Word shows me a message that the file cannot be open because a the file has a not valid xml character.
Thanks for your help
If it's latin-1, you might try tell your xml-file that
<?xml version="1.0" encoding="ISO-8859-1"?>
If it's utf-8 the same goes
<?xml version="1.0" encoding="UTF-8"?>
If you open up your xml-file in a decent text editor (eclipse to name one), you can check out its properties. There you can see what encoding the file is interpreted in.
I personally think Latin-1 is seldom the right choice due to its narrow character-set. (no € for example)
精彩评论