Justin
Justin

Reputation: 886

Invalid XML character §

I am having a issue with characters in my XML when I view it on a website. The character I want to be put in is § and what is coming out is § and my xml is <?xml version="1.0" encoding="UTF-8"?>. Any suggestions? Thanks!!

Upvotes: 0

Views: 440

Answers (2)

Banana
Banana

Reputation: 7463

instead of the character § you can use its html code which is either &#167 or &sect.

have a look here Ascii Code, every ascii symbol has a dedicated html code that can be used instead of the symbol.

like the unbreakable space which i am sure you are familiar with: &nbsp

Upvotes: 0

Jukka K. Korpela
Jukka K. Korpela

Reputation: 201568

If you see “§” as “§”, then the reason is usually that the data contains “§” SECTION SIGN U+00A7 as UTF-8 encoded, as bytes 0xC2 0xA7, but it is being misinterpreted as being in an 8-bit encoding like windows-1252 or ISO-8859-1. Alternatively, an incorrect character code conversion (“double UTF-8 encoding”) has taken place.

Check out the HTTP headers of the web page. If they declare an encoding other than UTF-8, they may override the in-document declaration.

Upvotes: 1

Related Questions