Unicode and the “asc” function

When converting your site into Unicode encoding (UTF-8 for instance), if you are using the “asc” function to check in what language is your users input, remember to replace the “asc” function with “ascw”.

“ascw” will return the Unicode number point corresponding with the character checked.

By checking the range of the characters in the user input against the Unicode character list you can figure what language has been used and make the appropriate adjustments (like changing the direction of the page or serving the correct interface language).

Leave a Reply

Your email address will not be published. Required fields are marked *