Hi All,
Is there a way to add other encodings to the "Re-open with encoding" menu? I only have Mac Roman, ISO-8859-1 and UTF8/UTF16 encodings in the list and I would like to add something like KOI8-R, CP-1251 etc. How can I do it?
Boris./
On 13/4/2006, at 17:15, Boris Bliznioukov wrote:
Is there a way to add other encodings to the "Re-open with encoding" menu? I only have Mac Roman, ISO-8859-1 and UTF8/UTF16 encodings in the list and I would like to add something like KOI8- R, CP-1251 etc. How can I do it?
There is no way to add to the menu, but you could create a new bundle with re-open commands, using iconv for the actual conversion.
Attached is such bundle with two example commands.
Notice though you will have to create similar commands, if you also want to save with one of these encodings.
On 14 Apr 2006, at 12:12, Allan Odgaard wrote:
On 13/4/2006, at 17:15, Boris Bliznioukov wrote:
Is there a way to add other encodings to the "Re-open with encoding" menu? I only have Mac Roman, ISO-8859-1 and UTF8/UTF16 encodings in the list and I would like to add something like KOI8- R, CP-1251 etc. How can I do it?
There is no way to add to the menu, but you could create a new bundle with re-open commands, using iconv for the actual conversion.
Attached is such bundle with two example commands.
The problem is that I not only want to open files with different encoding but also to save them back in the same encoding. I guess I can do it with bundles too, but it is a little bit inconvenient. Please think about this. And thank you very much for the help :)
On 14/4/2006, at 12:24, Boris Bliznioukov wrote:
The problem is that I not only want to open files with different encoding but also to save them back in the same encoding [...]
I hope this is only for existing files, because for new stuff you should use UTF-8.
If you accept text from a web page, if you keep text in a data base, or similar, UTF-8 is the only encoding [1] which allow storing of all type-able characters -- so use anything else, and you will likely see problems (such as truncated/mangled characters) -- even when you restrict content to English (or similar) you may still see names, quotes, references, and similar use “funny” characters.
Furthermore, UTF-8 is the only encoding where the text editor can guess the encoding, meaning you will never have to do “Re-open With” which is simply impossible with any other encoding. And having to manually do “Re-open With” each time you open a file (or at least ensure the editor guessed correctly) sounds like quite a pain.
And, TextMate 2.0 will start to see commands run directly on the files on disk for various actions. There is no way these commands will be able to incorporate fancy encoding guessing heuristics, UI for letting the user choose encoding, or similar.
There are already commands in the current version of TextMate which present a subset of a file, or part of the file retrieved from elsewhere, e.g. the Subversion actions such as Blame, Diff With XXX, etc. Again, there is no way these commands can get the encoding right -- so they will assume UTF-8.
I have said it before, but I will say it again: Use UTF-8! It’s not a matter of personal preference, UTF-8 is the far superior encoding, and all other encodings have serious problems which do come up in real life!
[1] “ASCII compatible” is implied in this and other claims.