VALUE must be `big' or `little' specifying big-endian and
little-endian respectively. The default value is `big'.
-This attribute is meaningful only when `:coding-type' is `utf-16'.
+Changing this attribute is only meaningful when `:coding-type'
+is `utf-16'.
`:ccl-decoder' (required if :coding-type is `ccl')
ptrdiff_t produced_chars = 0;
int c;
- if (CODING_UTF_8_BOM (coding) == utf_with_bom)
+ if (CODING_UTF_8_BOM (coding) != utf_without_bom)
{
ASSURE_DESTINATION (3);
EMIT_THREE_BYTES (UTF_8_BOM_1, UTF_8_BOM_2, UTF_8_BOM_3);
(defun coding-tests (content-type write-coding read-coding detected-coding
&optional translator)
- (prefer-coding-system 'utf-8-auto)
- (let ((filename (coding-tests-filename content-type write-coding)))
- (with-temp-buffer
- (let ((coding-system-for-read read-coding)
- (contents (coding-tests-file-contents content-type))
- (disable-ascii-optimization nil))
- (if translator
- (setq contents (funcall translator contents)))
- (insert-file-contents filename)
- (if (and (coding-system-equal buffer-file-coding-system detected-coding)
- (string= (buffer-string) contents))
- nil
- (list buffer-file-coding-system
- (string-to-list (buffer-string))
- (string-to-list contents)))))))
+ (with-coding-priority '(utf-8-auto)
+ (let ((filename (coding-tests-filename content-type write-coding)))
+ (with-temp-buffer
+ (let ((coding-system-for-read read-coding)
+ (contents (coding-tests-file-contents content-type))
+ (disable-ascii-optimization nil))
+ (if translator
+ (setq contents (funcall translator contents)))
+ (insert-file-contents filename)
+ (if (and (coding-system-equal buffer-file-coding-system detected-coding)
+ (string= (buffer-string) contents))
+ nil
+ (list buffer-file-coding-system
+ (string-to-list (buffer-string))
+ (string-to-list contents))))))))
(ert-deftest ert-test-coding-ascii ()
(unwind-protect