Compdigitec Labs

« | Home | »

Using (X)HTML entities in plain XML files

By admin | July 14, 2009

Update (2009-07-28): Here is a place that you can find accents for English characters.

If you try to use non-ASCII characters (e.g. accents) in directly in a Windows-1252 (ISO-8859-1) encoded web page directly without converting/transforming them into an entity, the web browser may get confused when the header of the web page is sent wrong or is misunderstood, resulting in garbled accents and even possibly mojibake.

The correct way to embed those into a web page are to use the corresponding (X)HTML entities such as ê for the ê accent. But if you try to load a string from a XML file into a web page (as many PHP scripts do nowadays), you will encounter a nasty error informing you that the entity was not defined (e.g. parser error : Entity ‘eacute’ not defined). To remedy this, in the XML file instead of the direct entity replace the ampersand (&) in the entity with its entity version. This may sound confusing at first but after a while it starts to make sense.

  • XML file display = ê
  • HTML source display = ê
  • Browser display = ê

If you found this article helpful or useful, please help Compdigitec spread the word. Don’t forget to subscribe to Compdigitec Labs for more useful or interesting articles!

If you found this article helpful or interesting, please help Compdigitec spread the word. Don’t forget to subscribe to Compdigitec Labs for more useful and interesting articles!

Topics: (X)HTML | 105 Comments »

105 Responses to “Using (X)HTML entities in plain XML files”

  1. Aorest Says:
    July 23rd, 2026 at 19:59

    ขอบคุณสำหรับบทความดีๆ เกี่ยวกับพวงหรีด

    Here is myy web blog … Aorest

  2. พวงหรีดปากคลองตลาด Says:
    July 23rd, 2026 at 20:07

    เนื้อหามีประโยชน์มาก ทำให้เข้าใจเรื่องการเลือกพวงหรีดได้ชัดเจน

    Here is my web site … พวงหรีดปากคลองตลาด

  3. Aorest Says:
    July 23rd, 2026 at 20:16

    เป็นบทความที่อ่านแล้วได้ไอเดียวิธีเลือกพวงหรีด เหมาะสมกับงานจริงๆ

    my site :: Aorest

  4. Aorest Says:
    July 23rd, 2026 at 20:34

    บทความนี้มีประโยชน์ ช่วยให้เลือกรูปแบบพวงหรีดได้ง่ายขึ้น

    Here iss my web-site: Aorest

  5. Aorest Says:
    July 23rd, 2026 at 21:37

    เป็นบทความที่อ่านแล้วได้ไอเดียวิธีเลือกพวงหรีดสวยงามกับงานจริงๆ

    Review my web page: Aorest

Comments