[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Very basic question regarding encoding and `open-network-stream'
From: |
Stefan Monnier |
Subject: |
Re: Very basic question regarding encoding and `open-network-stream' |
Date: |
Tue, 27 Nov 2018 18:17:43 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
> The NNTP RFC notes that the default character set for the protocol has
> changed from ascii to utf-8.
> (https://tools.ietf.org/html/rfc3977#section-1)
>
> What I don't grasp is: if the process buffers are left multibyte, and
> the `coding-system-for-read/write' variables are changed to 'utf-8 (or
> 'undecided?), will this simply do the right thing?
No: the stream of bytes includes NNTP protocol commands as well as other
contents (typically actual messages) and they don't all use utf-8.
So the stream process needs to communicate in bytes (aka "unibyte"), and
then the Elisp code needs to decode/encode each part manually according
to the coding system that applies to each part.
Stefan