Subject: Re: bug#46342: 28.0.50; socks-send-command munges IP address bytes to UTF-8

From: Eli Zaretskii <[email-masked]>
Date: Sat, 06 Feb 2021 14:26:31 +0200

> From: "J.P." <[email-masked]>
> Date: Sat, 06 Feb 2021 03:46:26 -0800
> 
> [2] Re coding-systems and proposed fix: I'm wondering if I should have
> used encode-coding-string (or something else) instead. Also: while
> socks--open-network-stream is perhaps the real culprit because it
> creates the offending string, I figured it's more resilient to have the
> function doing the sending to massage any IP address it encounters.

Emacs holds all non-ASCII characters internally in (a superset of)
UTF-8 encoding.  When passing those strings to external programs or
network connections, they should be encoded as appropriate.

What I don't understand is what is the "appropriate" encoding in this
case.  Can you explain why you use literal bytes in the test?  What
are those bytes supposed to stand for, and which program is supposed
to receive this sequence of bytes on the other end of the connect
command?

Thanks.