tags:

views:

66

answers:

5

i want to know how to store this è (this type of symbols) in xml file

if i store this symbol in xml file..

the file shows this symbol like �

i was inserted in front of xml file is <?xml version="1.0" encoding="UTF-8"?>

but that doest not shows correct

thanks and advance

+2  A: 

You have a character encoding problem. The encoding used to save the file does not match the one being used to read the file. Ideally, both should use an encoding like UTF-8. Ensure you are writing and reading the file correctly in this regard. You would have to show more about what you are doing to get a more specific reply.

Sean Owen
A: 

hi, I had a similar problem today...in my case the file wasn't saved as UTF-8...

try e.g. notepad++ (maybe windows editor supports this also) and change the encoding to utf8. after this replace the silly symbol by your é again.

this should help ;-)

poeschlorn
+3  A: 

Did you remember your XML declaration?

<?xml version="1.0" encoding="UTF-8"?>
<element>egalité</element>

You also need to ensure that the document is actually stored as UTF-8; check the encoding settings of the text editor used to make it for this.

Williham Totland
He did. He just didn't format the code in his question so that the xml declaration disappeared. This problem is likely caused by saving the file using the wrong encoding.
BalusC
@BalusC: Well, I answered before you edited his reply to make it pop. ;) Still a useful part of the answer, I feel. :P
Williham Totland
A: 

If you save xml file encodind in UTF-8 (in Notepad use save as and choose UTF-8 encoding) and start your xml file with the line

<?xml version="1.0" encoding="UTF-8"?>

it will work. To verify your results just open xml file in Internet Explorer.

Oleg
A: 

If you have problem while you insert

<?xml version="1.0" encoding="UTF-8"?> 

inside of your XML Document, Then you don't save your xml as a UTF-8 document. to do this.

Copy all of you XML contentin memory, open 'notepad' and Paste the content in 'notepad'. then Save your document as a Unicode document (from save dialog box (file type))

Nasser Hadjloo