Just today I needed to decode HTML encoded text in FileMaker. I thought this must have been done many times before, so I tried to search for a suitable custom function at BrianDunning.com and FMFunctions.com. After checking few functions I found one that seemed pretty good. Written in 2009 by Fabrice Nordman and named HTMLencoded2Text, this custom function was converting my imported text OK at first sight.
See the custom function at FMFunctions.com:
http://www.fmfunctions.com/functions_display_record.php?functionId=178
But later I discovered that this function still does not convert all characters. For instance the “latin small letter s with caron” which is often used in Czech was missing.
I didn’t want to add missing characters by try-and-fix approach, so I looked for some well formatted list of named html character entities on the web, and finally found this website: http://alumnus.caltech.edu/~leif/namedchar.html
It was easy to modify the HTML to leave only a single consistent table there, which I could copy and paste to Numbers. Then I saved the Numbers document as Excel and converted to FileMaker. Now I was in an environment where I feel at home… ;-)
Finally, I ended up with a sample file that generated an updated version of HTMLencoded2Text custom function, taking all the named character entity definitions from the database.
Feel free to download the file and use it not only as a generator of this custom function, but also as an inspiration for solving your own issues like this one.