* Haines Brown ([EMAIL PROTECTED]) [031208 13:33]: > I'm running emacs 21.2.1 on debian 3.0, and the default coding system > is utf-16. That is, when I save any file in emacs having an accented > character, it doubles in size and is a 16-bit file.
I just did some experimenting; hope this helps. I generally run with LANG=en_US.UTF-8: [EMAIL PROTECTED]:~$ locale LANG=en_US.UTF-8 LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL= I just did emacs /tmp/foo to create a new file. C-x RET C-\ (select-input-method) and entered "spanish-postfix". I typed a single 'Ã'. Saved the file; no prompt for encoding. Exit emacs. [EMAIL PROTECTED]:~$ file /tmp/foo /tmp/foo: UTF-8 Unicode text, with no line terminators Looks good. Then: [EMAIL PROTECTED]:~$ rm /tmp/foo [EMAIL PROTECTED]:~$ env LANG=C emacs /tmp/foo Same as before, I entered an à and saved. Again, no prompt for encoding. Exit emacs, and: [EMAIL PROTECTED]:~$ file /tmp/foo /tmp/foo: very short file (no magic) Vim doesn't make sense of this new file, either (neither when run in my default UTF-8 locale nor in the C locale). It's one byte (0xE1), which I just looked up: it's à in ISO-8859-1. So this isn't really The Answer, but more data, out of which you can hopefully make some sense. My suggestion to you is to try dpkg-reconfigure locales and select en_US.UTF-8 (and make sure there are no non-UTF-8 locales selected). Then put 'LANG=en_US.UTF-8' in your bashrc. Log out and log back in, and emacs should do the right thing (hopefully -- it does here, anyway). BTW, if `locale` is showing you POSIX now, you're using the POSIX locale, which is _not_ UTF-8. I'll also add that when I was playing around with emacs a bit, I tried the japanese input method and put only some hiragana in a file. Then when saving the file, emacs did prompt me for encoding, defaulting to euc-jp. I haven't dug around at all in emacs' documentation, .el files, or customize to see where it might be set about whether or not to prompt and what is the default based on buffer contents or some other criteria. I really have no experience working with MULE at all. good times, Vineet -- http://www.doorstop.net/ -- "Those who desire to give up freedom in order to gain security will not have, nor do they deserve, either one." --President Thomas Jefferson
signature.asc
Description: Digital signature