Subject: 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 17:15:50 +0200

> From: "J.P." <[email-masked]>
> Cc: [email-masked]
> Date: Sat, 06 Feb 2021 06:19:55 -0800
> 
> Re appropriate encoding: correct me if I'm wrong (internet), but among
> the Emacs coding systems, it'd be latin-1.

That depends on what the other end expects.  Does it expect latin-1 in
this case?

> In the proposed patch for socks-send-command, swapping out the call
> to unibyte-string with (encode-coding-string address 'latin-1) has
> the same effect of preserving, say, char 216 as the single byte
> "\330" and not "\303\230".

Does emitting the single byte \330 produce the correct result in this
case?  Then by all means please use

   (encode-coding-string address 'latin-1)

> Re program on the other end: this would be any program offering a proxy
> service that speaks the same protocol. Popular ones include tor and ssh.
> There's also a "bind" command that allows your client (Emacs) to act as
> a server and listen/accept connections on the remote end as if they were
> present on your local network.

And those expect Latin-1 encoding in this case?