summaryrefslogtreecommitdiff
path: root/src/coding.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2023-01-12 16:36:35 +0200
committerEli Zaretskii <eliz@gnu.org>2023-01-12 16:36:35 +0200
commitcfd2b3504ab5de6eb5f3c7a0784cb447883e1326 (patch)
tree05cd282566387e4c469e44830f50586dd56ae026 /src/coding.c
parent53b47df8229a3a54777940663edda28de0a01b90 (diff)
downloademacs-cfd2b3504ab5de6eb5f3c7a0784cb447883e1326.tar.gz
emacs-cfd2b3504ab5de6eb5f3c7a0784cb447883e1326.tar.bz2
emacs-cfd2b3504ab5de6eb5f3c7a0784cb447883e1326.zip
Fix encoding with 'utf-8-auto'
* src/coding.c (encode_coding_utf_8): Fix encoding with 'utf-8-auto': it should produce BOM, per the documentation of the :bom attribute. (Bug#60750) * lisp/international/mule.el (define-coding-system): Doc fix. * test/src/coding-tests.el (coding-tests): Use 'with-coding-priority' instead of 'prefer-coding-system', as the latter has global persistent effect and affects further tests.
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/coding.c b/src/coding.c
index 4e59f2b6a1b..49dcd8634f3 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -1431,7 +1431,7 @@ encode_coding_utf_8 (struct coding_system *coding)
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);