unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Jean Abou Samra <jean@abou-samra.fr>
To: 56675@debbugs.gnu.org
Subject: bug#56675: UTF16 encoding adds BOM before every single character
Date: Wed, 20 Jul 2022 23:39:57 +0200	[thread overview]
Message-ID: <bac17cbb-53db-c644-e16e-f9f3faa3e10e@abou-samra.fr> (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
https://lists.gnu.org/archive/html/guile-user/2022-07/msg00041.html






                 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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

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

  git send-email \
    --in-reply-to=bac17cbb-53db-c644-e16e-f9f3faa3e10e@abou-samra.fr \
    --to=jean@abou-samra.fr \
    --cc=56675@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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).