hussain
hussain

Reputation: 155

utf8 format in xml

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

Upvotes: 0

Views: 9626

Answers (5)

Nasser Hadjloo
Nasser Hadjloo

Reputation: 12610

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))

Upvotes: 0

Oleg
Oleg

Reputation: 221997

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.

Upvotes: 0

Williham Totland
Williham Totland

Reputation: 28999

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.

Upvotes: 3

poeschlorn
poeschlorn

Reputation: 12440

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 ;-)

Upvotes: 0

Sean Owen
Sean Owen

Reputation: 66876

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.

Upvotes: 2

Related Questions