[TxMt] Replace latin-1 characters

Allan Odgaard throw-away-1 at macromates.com
Mon Feb 13 00:44:28 UTC 2006

On 12/2/2006, at 18:10, Andreas Wahlin wrote:

> [ content-type encoding ]
> Because I'm currently not in control of it :(

There are a few ways you may be able to set the encoding (from IMHO  
most to least desired):

.htaccess: Put “AddDefaultCharset utf-8” or (for selected file types)  
“AddCharset utf-8 .txt .html” in your .htaccess file.

Content negotiation: Name the file e.g. “my_page.html.utf8” to  
trigger content negotiation.

Sending your own header: If the page is e.g. PHP, you can use  
something like: Header("Content-Type: text/html; charset=UTF-8");.

If neither of this works, I'd consider sending a kind letter to the  
host. Converting all files to/from entities from within TextMate  
isn't feasible, but you could create a script that does it (to  
current Convert to Entities command is written in Ruby, and could  
serve as basis for such script).

More information about the textmate mailing list