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 | 1,602 Comments »

1,602 Responses to “Using (X)HTML entities in plain XML files”

  1. BoonForal Flowers Says:
    June 7th, 2026 at 13:38

    บทความนี้เกี่ยวกับพวงหรีดดอกไม้
    เป็นประโยชน์สุดๆ
    โดยส่วนตัวเพิ่งจัดงานศพให้ผู้ใหญ่ในบ้าน การเลือกพวงหรีดเลยเป็นเรื่องที่ต้องใส่ใจ
    จะบอกต่อให้เพื่อนๆ ที่ต้องการเลือกดอกไม้ไปงานศพอ่านด้วย

    Here is my page – BoonForal Flowers

  2. จัดดอกไม้งานศพ Says:
    June 8th, 2026 at 03:06

    ให้บริการออกแบบดอกไม้งานศพทั้งแบบไทยและสากล พร้อมทีมงานมืออาชีพ บริการรวดเร็ว ราคายุติธรรม สั่งได้ทั้งในกรุงเทพฯ และปริมณฑล

    Here is my blog; https://intered.Help-On.org/blog/index.php?entryid=200831

Comments