sunam
sunam

Reputation: 191

ê (Unicode character) XML Parsing Error: not well-formed

I have a C++ code with which am creating a SVG document. I have the character, ê, in a block of text. This document gets displayed correctly if I say

xml version="1.0" encoding="ISO-8859-1"

but does not work with encoding="UTF-8" or UTF-16 or default encoding which should also be utf-8. I tried Firefox, Opera and Rekonq on Ubuntu. Same response by all 3.

I don't understand this because utf-8 is supposed to display ê. Can anyone explain please?

Upvotes: 0

Views: 2705

Answers (1)

deceze
deceze

Reputation: 522635

<xml ... encoding="ISO-8859-1"> just indicates what encoding the document is supposedly in. It does not change the encoding of the document. If it works when indicating the document to be in ISO-8859-1, but not with anything else, then that means the document is actually encoded in ISO-8859-1 and not anything else.

If you want a UTF-8 file, you need to actually encode the document in UTF-8 and indicate it as such in the <xml> declaration.

If you have no idea what that means, see What Every Programmer Absolutely, Positively Needs To Know About Encodings And Character Sets To Work With Text.

Upvotes: 1

Related Questions