After closing and opening 'test.txt' again and clicking 'File -> Save As…' turns out the encoding is 'Chinese - GB18030', even though the encoding is set to 'Unicode - UTF-8' in the settings.

What may have happened is that documents were being created by something other than TextMate with 'Western (Mac OS Roman)' encoding, but when opened with TextMate, it was not converting them to UTF-8 properly, or detecting that they had a different encoding. TextMate should detect the encoding and when saving should either convert to whatever the 'Preferences' encoding is, or save in the same encoding the file was originally opened in.

Attempted to replicate the bug with documents created in TextMate but couldn't. Created a document in another application with UTF-8 encoding, and then opened and saved in TextMate with the same encoding and it saved properly.

On 14 Oct 2015, at 11:15, Allan Odgaard <> wrote:

On 14 Oct 2015, at 17:00, Kalcifer Kandari wrote:

Just replicated the bug again with a clean install (including all defaults reverted), here are the exact steps to replicate (using TextMate version 2 beta 8):
create new file
press alt+; for the ellipses
press cmd+s to save
close file

Once you have saved the file, can you run this in a terminal:

   xxd /path/to/file

Also, after re-opening the file, can you try use Save As… (⇧⌘S) and tell me what is shown as encoding?

textmate mailing list