开发者

Problem with Latin character using JavaDocx

开发者 https://www.devze.com 2023-03-10 10:56 出处:网络
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

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)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号