[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
`write-region' writes different bytes than passed to it?
From: |
Philipp Stephani |
Subject: |
`write-region' writes different bytes than passed to it? |
Date: |
Tue, 11 Dec 2018 13:30:07 +0100 |
Hi,
usually `write-region' uses the coding system bound to
`coding-system-for-write'. However, I've found a case where this
doesn't seem to be the case:
$ emacs -Q -batch -eval '(let ((coding-system-for-write (quote
utf-8-unix))) (write-region "\xC1\xB2" nil "/tmp/test.txt"))' && hd
/tmp/test.txt
00000000 f2 |.|
00000001
That is, instead of the byte sequence C1 B2 it writes the single byte
F2, which is an invalid UTF-8 sequence. Is that expected?
Thanks,
Philipp