all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* `write-region' writes different bytes than passed to it?
@ 2018-12-11 12:30 Philipp Stephani
  2018-12-11 12:42 ` Philipp Stephani
  2018-12-11 15:41 ` Eli Zaretskii
  0 siblings, 2 replies; 24+ messages in thread
From: Philipp Stephani @ 2018-12-11 12:30 UTC (permalink / raw)
  To: help-gnu-emacs

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



^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2019-02-11 22:06 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-11 12:30 `write-region' writes different bytes than passed to it? Philipp Stephani
2018-12-11 12:42 ` Philipp Stephani
2018-12-11 15:42   ` Eli Zaretskii
2018-12-11 15:41 ` Eli Zaretskii
2018-12-11 16:36   ` Stefan Monnier
2018-12-11 18:05     ` Eli Zaretskii
2018-12-11 19:47       ` Stefan Monnier
2018-12-22 23:16         ` Philipp Stephani
2018-12-22 23:13       ` Philipp Stephani
2018-12-22 22:59     ` Philipp Stephani
2018-12-22 22:58   ` Philipp Stephani
2018-12-23 15:20     ` Eli Zaretskii
2019-02-10 19:06       ` Philipp Stephani
2019-02-10 20:05         ` Eli Zaretskii
2018-12-24  4:27     ` Stefan Monnier
2019-02-10 19:15       ` Philipp Stephani
2019-02-10 20:13         ` Eli Zaretskii
2019-02-10 22:25         ` Stefan Monnier
2019-02-11  3:31           ` Eli Zaretskii
2019-02-11 14:05             ` Stefan Monnier
2019-02-11 16:37               ` Eli Zaretskii
2019-02-11 19:44                 ` Stefan Monnier
2019-02-11 20:20                   ` Eli Zaretskii
2019-02-11 22:06                     ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.