A little PHP tip regarding Urdu

In plain html, we often have (”) double quotes, and (’) single quotes. A special php function called htmlspecialchars is used to convert them to their char codes. For some unexplained reasons, even if you supply “utf-8” as an argument for the char-set to this function, it still converts all utf-8 chars to their codes. So in all of my php-pages, whether of Wordpress, or UrduWiki (WikkaWiki), I comment out this function, or in other words the special char translation, otherwise, the display seems quite okay but in editing, you will get codes like (& # 12541 ; ) instead of Urdu unicode characters which are quite impossible to edit.

One Response to “A little PHP tip regarding Urdu”

  1. زکریا Says:

    There is also another PHP function @htmlentities@ which does something similar.

    In Movable Type, there is a configuration option which fixes this issue.

Leave a Reply