Blog

A OS X service to encode HTML characters

I find myself frequently writing HTML code in comment forms which support use of HTML formatting, which means that I have to encode the html entities if I want them to show up (as in representing ‘>’ with ‘>’, for example).

This gets rather tiresome, particularly if there’s a fair chunk of text to encode by hand.

I used the always-useful ThisService app with a short PHP script which does a htmlspecialchars() on whatever’s passed to it, to create a OS X service called ‘Encode HTML‘. Put it in your Library/Services directory, possibly log out and back in again, and you’ll be set.

Select the text to encode, click the system menu, Services, Encode HTML, and it’ll be automatically encoded in place.

, , , . Bookmark the permalink. Both comments and trackbacks are currently closed.