[TxMt] UTF8 bom

Allan Odgaard throw-away-1 at macromates.com
Mon Apr 30 21:51:54 UTC 2007


On 30. Apr 2007, at 21:50, David Zhou wrote:

> Is there a way to add a BOM marker to a UTF8 file created by Textmate?
>
> Homesite on Windows doesn't seem to be reading files created by  
> Textmate correctly as UTF8 -- I have a suspicion this may have  
> something to do with the lack of a BOM marker in the beginning.

For the records, I talked with David on IRC and we created this  
command, which adds a BOM to the currently open file (which TM will  
then preserve):

-------------- next part --------------
A non-text attachment was scrubbed...
Name: BOM Test.tmCommand
Type: application/octet-stream
Size: 669 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20070430/aadf3210/attachment.tmCommand>
-------------- next part --------------


Though this comes with the usual disclaimer about not using BOM?s in  
UTF-8, since it is bad for compatibility, e.g. the shell won?t  
understand the shebang line, merging multiple files using cat, grep,  
or similar, may cause BOM?s to end up in the middle of the file (and/ 
or not at the start of the result), etc.



More information about the textmate mailing list