[TxMt] Encoding problem

Ed Wong wonge at rogers.com
Fri Oct 14 20:58:32 UTC 2005


On 14-10-05 4:07 pm, "Allan Odgaard" <throw-away-1 at macromates.com> wrote:

> If you save a file w/o 8 bit characters it is saved as ASCII, no
> matter what encoding you specify.
> 
> TextMate will then open it as ASCII, and if you enter non-ASCII
> characters and save it again, it will ³upgrade² it to utf-8, unless
> you've set the preferences to something else AND checked that this
> should apply to existing files as well AND the encoding you've
> specified can actually represent the characters in the buffer --
> otherwise this choice is only honered when the file is encoding less,
> so to speak (i.e. for new buffers).

In my case I do have all 3 conditions you specified above and when reopened
it doesn't show the accented characters properly. Unless I'm
misunderstanding what you're saying. So even if I save a file using an
encoding like Latin1 and specify that files will use Latin1 in Preferences
and should apply to existing file, it will open the file as ASCII?
                   
> That said, you really really should be using utf-8. utf-8 is also the
> only encoding that TM can safely recognize, since text files do not
> specify encodings, but utf-8 is made in such a way that statistically
> you just don't get a false positive for that encoding -- not to
> mention that all the other 8 bit encodings are lossy and can't
> represent all the characters you can type.

This is fine but I something need to edit other people's files and they may
be saved using a different encoding. I know, use iconv... ;-)

Thanks,
Ed





More information about the textmate mailing list