HTML en- & decoding - (Yes, that's different from URL encoding)

Log in to Vote
5
5 Votes • 1 Comment
Hey! ...It's been way too long time since I've submitted an Instant Answer idea! : O
But, I have collected a couple ones, lately. So this is part 1, this time:

The idea: Make it possible to encode (special) characters like é, æ and ö etc. into their respective HTML encoded versions (so-called "HTML entities").

Trigger(s): For example, searching for "html encode é" would return something like "%C3%A9 (HTML encoded)".

The above example result ("layout") is basen on the returned answer/result of the "URL encode"-IA.

Decoding of a given HTML entity (using a similar "query syntax") would be much appreciated, too.
By this I mean it should be possible to decode HTML entities by searching for "html decode <some HTML entity>".
For example searching for "html decode &copy;".

I know it's possible to to just search for the HTML entity itself, cf. this IA.
But, it would just be nice to be able to use the same "query syntax" as when percent (en/de)coding text.

NB: HTML (en/de)coding is different form URL/"percent" (en/de)coding.
Please see HTML entities vs. Percent encoding on Wikipedia, respectively.
• posted 4 years and 8 months ago Improvement

TopHattedCoder
This could be implemented as a spice by setting the .textcontent property of an element to the string then getting the .innerHTML of that element.
Alternatively, this could be implemented as a goodie by using the HTML::Entities CPAN library to encode / decode it.
posted by TopHattedCoder Community Leader4 years and 8 months ago Link