0

I just got JavaDocx free library two days ago. 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

user783057
  • 11
  • 3
  • I wonder if the answer at http://stackoverflow.com/questions/1571626/simplyxml-and-accented-characters-in-php/1572421#1572421 would help you. – rajah9 Jun 03 '11 at 17:20
  • Hi! We've seen this same question at JavaDocx forums and apparently the user came to the solution by himself, because a few hours later he posted: "The problem is solved!!! The problem was that the encoding used by eclipse is cp1252, thus the solution was to change the encoding to utf8." It's not a library issue, but we thought this info could be useful for those in the same case as user783057 so we posted it here :) Cheers, JavaDocX Team – PHPDocX - JavaDocX Jun 06 '11 at 13:47

1 Answers1

0

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)

Peter
  • 47,963
  • 46
  • 132
  • 181