Mercurial > emacs
comparison lisp/international/mule.el @ 91926:d2f0754ed2f5
(xml-find-file-coding-system): Don't warn about utf-16 with BOM.
author | Jason Rumney <jasonr@gnu.org> |
---|---|
date | Mon, 18 Feb 2008 02:40:38 +0000 |
parents | 89b7a215ead9 |
children | 3d15658dfdee |
comparison
equal
deleted
inserted
replaced
91925:70ae8b5ec55d | 91926:d2f0754ed2f5 |
---|---|
2339 (let ((detected | 2339 (let ((detected |
2340 (with-coding-priority '(utf-8) | 2340 (with-coding-priority '(utf-8) |
2341 (coding-system-base | 2341 (coding-system-base |
2342 (detect-coding-region (point-min) (point-max) t))))) | 2342 (detect-coding-region (point-min) (point-max) t))))) |
2343 ;; Pure ASCII always comes back as undecided. | 2343 ;; Pure ASCII always comes back as undecided. |
2344 (if (memq detected '(utf-8 undecided)) | 2344 (cond |
2345 'utf-8 | 2345 ((memq detected '(utf-8 undecided)) |
2346 'utf-8) | |
2347 ((eq detected 'utf-16le-with-signature) 'utf-16le-with-signature) | |
2348 ((eq detected 'utf-16be-with-signature) 'utf-16be-with-signature) | |
2349 (t | |
2346 (warn "File contents detected as %s. | 2350 (warn "File contents detected as %s. |
2347 Consider adding an xml declaration with the encoding specified, | 2351 Consider adding an xml declaration with the encoding specified, |
2348 or saving as utf-8, as mandated by the xml specification." detected) | 2352 or saving as utf-8, as mandated by the xml specification." detected) |
2349 detected)) | 2353 detected))) |
2350 ;; Don't interfere with the user's wishes for saving the buffer. | 2354 ;; Don't interfere with the user's wishes for saving the buffer. |
2351 ;; We did what we could when the buffer was created to ensure the | 2355 ;; We did what we could when the buffer was created to ensure the |
2352 ;; correct encoding was used, or the user was warned, so any | 2356 ;; correct encoding was used, or the user was warned, so any |
2353 ;; non-conformity here is deliberate on the part of the user. | 2357 ;; non-conformity here is deliberate on the part of the user. |
2354 'undecided)) | 2358 'undecided)) |