Function: nxml-fix-encoding-declaration
nxml-fix-encoding-declaration is a byte-compiled function defined in
nxml-mode.el.gz.
Signature
(nxml-fix-encoding-declaration ENC-POS CODING-SYSTEM)
Source Code
;; Defined in /usr/src/emacs/lisp/nxml/nxml-mode.el.gz
(defun nxml-fix-encoding-declaration (enc-pos coding-system)
(let ((charset (nxml-coding-system-name coding-system)))
(cond ((consp enc-pos)
(delete-region (car enc-pos) (cdr enc-pos))
(goto-char (car enc-pos))
(insert charset))
((integerp enc-pos)
(goto-char enc-pos)
(insert " encoding=\"" charset ?\"))
(t
(goto-char (point-min))
(insert "<?xml version=\"1.0\" encoding=\""
charset
"\"?>\n")
(when (and (not enc-pos)
(let ((case-fold-search t))
(looking-at xmltok-bad-xml-decl-regexp)))
(delete-region (point) (match-end 0)))))))