unofficial mirror of 
 help / color / mirror / Atom feed
From: Jean Abou Samra <>
Subject: bug#56675: UTF16 encoding adds BOM before every single character
Date: Wed, 20 Jul 2022 23:39:57 +0200	[thread overview]
Message-ID: <> (raw)

With this code:

(let ((p (open-output-file "x.txt")))
    (set-port-encoding! p "UTF16")
    (display "ABC" p)
    (close-port p))

the sequence of bytes in the output file x.txt is

['FF', 'FE', '41', '0', 'FF', 'FE', '42', '0', 'FF', 'FE', '43', '0']

As you can see, a BOM is being added before every
single character instead of just at the beginning.

Originally reported at

                 reply	other threads:[~2022-07-20 21:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).