Page to Unicode Thaana 1.0

Here's a nifty little tool I made a few years ago that automatically and intelligently picks out the bits of text that use a non-Unicode Thaana font on any web page and converts it to Unicode. That probably doesn't make much sense to most of you but read on - there's a section for general web users and one for developers.

General users


Take the website of Haveeru Daily as an example. It uses a now-archaic method of displaying Thaana. Browsers cannot and will not substitute an alternative workable font if your computer does not have the exact Thaana fonts it requires and will display as non-sensical English text. But then take Miadhu Daily, which relies on something called Unicode. Browsers can and will load up the site perfectly readable as long as you have any one of the many Unicode Thaana fonts on your system. And in many situations, like at public libraries or on some phones and devices like the Kindle, Unicode-based Thaana web pages will load up just fine as there usually is some Thaana-supporting Unicode font on it while those that use the more archaic method will fail.

I came across this problem a few years ago while at the university lab one day and there was some interesting events taking place in the Maldives which I wanted to read about. Haveeru had the most news articles and was the most up-to-date but I couldn't read any of it as the Thaana fonts were not on the system and I was not allowed to install the fonts. So I wrote some quick code, specifically a bookmarklet, that converted the text on the site on-the-fly to use Unicode.

Anyway, if you find yourself in a similar situation, here is what you could do. Right click the PUT bookmarklet link below and choose to bookmark the link. When on a page, just click the PUT bookmark and the page should convert to Unicode and display Thaana.

Page to Unicode Thaana bookmarklet v1.0

Demo

Haveeru before


Haveeru after


Developers


Here's a slightly different version of the above script that can be used on web pages that do not use Unicode Thaana to offer the pages in Unicode without requiring any change to the content management system, editor etc that you have in place already. Add the script to your non-Unicode Thaana based web pages where appropriate and your visitors will get a Unicode-based web page as long they have Javascript enabled.

Usage
I would recommend that it be added towards the end of your page HTML, right before the closing BODY tag.



Download:
- put-1.0.min.js (minified, for production use)
- put-1.0.js (full source)

Enjoy :-)