Jan20

Displaying non ascii characters in html

Posted by: Brian Chan | Filed in: technology | Tags: | 04:00 pm, January 20th, 2012 Add comments

This happens very often. We have some non ascii characters to display on a webpage. Without properly encoding, we see funny latin letters or squares displayed instead.

This is not an “international” issue. Even in the US, when users copy and paste content from a word document, that content often contains non-ascii characters, say the bulletin points. After such content gets inserted in the db, that content often simply gets blindly displayed onto a webpage along with other well-behaved data. So we see the funny characters again.

Assuming the database has the right stuff, the simple solution to fixing this is the following.

1
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset="UTF-8">

Just put that in your html head section. You webpage should then be displayed properly.

Ref link: http://www.terena.org/activities/multiling/euroml/tests/html-eurolat1.html




Related posts:

  1. blob sizes
  2. Stop UTF 8 with javascript
  3. text wrapping in the html pre tag

Leave a Reply