bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#56675: UTF16 encoding adds BOM before every single character


From: Jean Abou Samra
Subject: bug#56675: UTF16 encoding adds BOM before every single character
Date: Wed, 20 Jul 2022 23:39:57 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0

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 via email to

[Prev in Thread] Current Thread [Next in Thread]