non-default file encodings?

Stephen J. Turnbull stephen at xemacs.org
Thu Jan 5 01:05:37 EST 2006


>>>>> "Rodney" == Rodney Sparapani <rsparapa at mcw.edu> writes:

    Rodney> However, I was wondering if there was a simple way or a
    Rodney> plan to support something like the following:

    Rodney> -*- cyrillic-iso8859-5 text -*-

They're sorta supported already, but it's a basically bad idea,
because sorta support is the best that can be done.  For one-shot use,
use C-u C-x C-f and friends as Glynn mentions.

If you get mojibake (Japanese for "changed characters", means
characters interpreted as a different encoding from what you expect),
this command could come in handy:

(defun recode-region (begin end from-coding to-coding)
  (interactive "r\nzCurrent coding (null for default)\nzDesired coding")
  (encode-coding-region begin end (or from-coding buffer-file-coding-system))
  (decode-coding-region begin end to-coding)
  (if (y-or-n-p (format "You likee codee %s? "
                      (coding-system-name to-coding)))
      (set-buffer-file-coding-system to-coding)
    (revert-buffer)))

You need to set the region first.  If you're not sure you can try a
small region, otherwise prefix with C-x h for the whole buffer.  The
buffer-modified flag will be set; don't save unless you know what
you're doing.


-- 
School of Systems and Information Engineering http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba                    Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
               Ask not how you can "do" free software business;
              ask what your business can "do for" free software.




More information about the XEmacs-Beta mailing list