[TextMate] htmlentitizing text

Allan Odgaard allan at macromates.com
Sun Oct 24 14:00:52 UTC 2004


On 24. Oct 2004, at 0:57, Allan Odgaard wrote:

> TextMate "exports" all text as utf-8. So æ, ø, and å would be 
> "mangled" as such (I've been wanting to put that in the manual! ;) ).
>
> If you only work with latin-1 characters, you could make the command 
> like this (two lines):

I just read the PHP manual for htmlentities, and it turns out that the 
encoding can be given as a third argument, so instead let the command 
be:
    php -r "echo htmlentities('$TM_SELECTED_TEXT', ENT_QUOTES, 'UTF-8');"

Then it'll work for all characters.


Kind regards Allan




More information about the textmate mailing list