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 | 251 Comments »

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

  1. X.com Says:
    October 21st, 2025 at 05:33

    เห็นด้วยมากครับ! การ จ้างช่าง ทุกวันนี้ง่ายกว่าสมัยก่อนเยอะ
    ตอนนี้มีเว็บและแอปที่รวม ผู้รับเหมา
    เราสามารถดูราคาเปรียบเทียบได้ก่อนจ้าง แถมมีรีวิวจากเจ้าของบ้านจริง ๆ
    ผมเพิ่งจ้างช่างมาปรับปรุงบ้านผ่านระบบนี้ งานดี ราคายุติธรรม
    เหมาะกับทั้งเจ้าของบ้านและช่างที่อยากรับงานเพิ่มจริง ๆ

    Here is my homepage :: https://X.com/Bee2002s/status/1977266171033657606

Comments