About This
I am Michael Tyson, and I run A Tasty Pixel. I write on a variety of technology and software development topics as I travel around Europe in a motorhome.
-
Subscribe to updates 510 feed subscribers
Follow me on Twitter 863 followers
Our Products
Newsletter
Let us keep you informed about important updates, special offers, and new products. Just type in your email address below and hit enter to sign up!
-
Recent Posts
Topics
Audio Business Career Cocoa Code Data Debugging Demo Design Development Geocoding Google Graphics Interface iPad iPhone Lifestyle Links Location Loopy Loopy HD Mac Maps Marketing Networking PHP Scripts Security Shell Social Comment Software Talkie Talkie-for-Mac The Cartographer Travel Tutorial Twitter Update Web Webapps WordPress WordPress Plugins WordPress Themes Workflow XCode



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.
Related posts