Re: [xml] Wrong entity reference

At 15:27 31/3/02, Daniel Gehriger wrote:
I need to include a degree sign (°) in an attribute. I tried both
(encoding UTF-8)

 <foo label="360°+/>


 <foo label="&#0176;/>

but xmlGetProp() always returns

 "360°" (that is, "360" + 'A' with a circumflex + degree sign).

Is there anything I'm missing ?

Yes: UTF-8. If you used UTF-8 in your first example, but looked at it with a Unicode-unaware editor, you'd see <foo label="360°"/>.

xmlGetProp() is returning 360°, encoded as UTF-8, and you're looking at it byte-by-byte instead of character-by-character.

Christopher R. Maden, Principal Consultant, crism consulting
DTDs/schemas - conversion - ebooks - publishing - Web - B2B - training
<URL: >
PGP Fingerprint: BBA6 4085 DED0 E176 D6D4  5DFC AC52 F825 AFEC 58DA

Attachment: pgpLwHold3NG0.pgp
Description: PGP signature

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]