Brian Dunning's FileMaker Custom Functions

@GetAsHTMLDecoded ( text )

HTML Character Entity Decoder

  Average rating: 5.0 (5 votes) Log in to vote

Alex Zueiv   Alex Zueiv - Show more from this author
Tashkent
https://github.com/zueiv

Share on Facebook Share on Twitter

  Sample input:
@GetAsHTMLDecoded ( "Hello Мир!" )
  Sample output:
Hello Мир!

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Recursive function for decoding HTML Character Entities.

This CF supports decimal and hexadecimal entity numbers of the whole Unicode table (x0…10FFFF). For compatibility with old systems, entity numbers in the range x80…9F are interpreted as in Windows-1252 (€‚ƒ\„…†‡ˆ‰ etc.)

The CF contains 1448 case-sensitive entity names with 583 synonyms from:

https://dev.w3.org/html5/html-author/charref

So, it is very large (>23K characters), which is yet a bit less than FMP allows (30K). In spite of the size it works quite fast – over 5К substitutions in less than a second.

 

Comments

JMLU   JMLU
Jul 8, 2020
I found it can't decode Chinese and Japanese. How do i modify it?
Example:
荧光
%E8%8D%A7%E5%85%89

ガングリオシド
%E3%82%AC%E3%83%B3%E3%82%B0%E3%83%AA%E3%82%AA%E3%82%B7%E3%83%89
 
Alex Zueiv   Alex Zueiv, Tashkent
Jul 8, 2020
It is not HTML, but URL (a.k.a. %) encoding. Use another function:

https://www.briandunning.com/cf/2095

@GetAsURLDecoded ( "%E8%8D%A7%E5%85%89" ; 1 ) // ==> 荧光
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: