I finally managed to get Win32 Emacs 21.2.1 to properly handle a Unicode text file. I’ve been meaning to get around to this for a while, because more and more often, the APIs in various Windows-based development platforms (among them Xbox) expect Unicode text files for configuration information. Even the Registry Editor (regedit) in Windows XP has jumped on the Unicode bandwagon, spewing forth Unicode text files when you export a registry entry.
I really despise having to edit text files in either Notepad or Visual Studio, neither of which offer me the editing speed brought about by years of using Emacs, but until now, opening a Unicode text file in Emacs produced mostly illegible garbage. Every other character is a null, which displays as ^@ in Emacs. The string foo, for example, turns into f^@o^@o^@. You just can’t edit that kind of garbage. Not safely, at any rate.
Fortunately, due largely to the efforts of Japanese programmers, the Mule-UCS Emacs Lisp library provides all the Unicode support I need. A little byte-compilation, a little file movement, and a little editing in my .emacs file, and Emacs is now a lean, mean, Unicode-editing machine.
My only complaint is that, even byte-compiled, it takes several seconds to load Mule-UCS when starting Emacs. Fortunately, it’s not difficult to load up the module when I need it with the eval-expression function (by default, bound to M-:). Manually evaluating (require 'un-define) is much less painful than waiting for the same line to evaluate from my .emacs file every time Emacs starts.
One Comment
A recipe detailing how you did it will be much appreciated.
thanks
++jrb