help-emacs-windows
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [h-e-w] Saving in utf-16-le encoding


From: James Todd
Subject: RE: [h-e-w] Saving in utf-16-le encoding
Date: Tue, 20 Sep 2005 13:27:53 -0400

I've seen this problem too. The utf-16-le-pre-write-conversion and
utf-16-be-pre-write-conversion functions don't actually seem to be
defined by default. I got around this by defining empty functions, and
also by setting the 'auto-coding-regexp-alist to automatically recognize
both LE and BE utf-16 files. I've the relevant elisp code below.

HTH,
James

;; Make emacs recognize a double byte utf-16 unicode file, which is
;; the unicode text file time commonly used under windows. We do this
;; by looking for the 4 byte marker (called 'BOM') at the start of the
;; file, which also indicates either big or little endian. "^\377\376"
;; is FFFE in octal.
(add-to-list 'auto-coding-regexp-alist '("^\377\376" . utf-16-le) t)
(add-to-list 'auto-coding-regexp-alist '("^\376\377" . utf-16-be) t)

;; The utf-16-le-pre-write-conversion function is called whenever
;; we're saving out a utf-16 text file. For some reason the function
;; doesn't exist in the distribution emacs files, so we define our
;; own.
(defun utf-16-le-pre-write-conversion (start end)
  nil
  )

(defun utf-16-be-pre-write-conversion (start end)
  nil
  )

-----Original Message-----
From: address@hidden
[mailto:address@hidden On
Behalf Of address@hidden
Sent: Tuesday, September 20, 2005 12:10 PM
To: address@hidden
Subject: [h-e-w] Saving in utf-16-le encoding

Hi,

I'm running Emacs 21.3.1 on NT4. I've got used to using C-x-<RET>-C
utf-16-le ... to read in files in Windows unicode format. However when I
try and use the same preliminary to save a file in the same encoding I
get a message:

Symbol's function definition is void: utf-16-le-pre-write-conversion

How can I fix this?

cheers,

Paul Bowman



-- 

------------------------------------------------------------------------
------
HBOS plc, Registered in Scotland No. SC218813. Registered Office: The
Mound, Edinburgh EH1 1YZ. HBOS plc is a holding company, subsidiaries of
which are authorised and regulated by the Financial Services Authority.
========================================================================
======







reply via email to

[Prev in Thread] Current Thread [Next in Thread]