From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani
> From: Philipp Stephani <p.stephani2@gmail.com>
> Date: Wed, 30 Nov 2016 18:23:14 +0000
> Cc: dgutov@yandex.ru, kentaro.nakazawa@nifty.com, em= acs-devel@gnu.org
>
>=C2=A0 > Yes, this is not a json.el problem at all. It does the corr= ect thing,
>=C2=A0 > and shouldn't be changed.
>
>=C2=A0 ??? Why should any code care whether a pure-ASCII string is mark= ed as
>=C2=A0 unibyte or as multibyte? Both are "correct".
>
> I guess the problem is that process-send-string cares. If it didn'= t, we wouldn't have the problem.
I don't think I follow.=C2=A0 The error we are talking about is signale= d
from url-http-create-request, not from process-send-string.
> For URL, we'd need functions like
> (byte-array-length s) =3D (length (string-to-unibyte s))
Why do you need this?=C2=A0 string-to-unibyte is well-defined only for
unibyte or ASCII strings (if we forget the raw bytes for a moment), so
length will do.
> (process-send-bytes s) =3D (process-send-string (string-to-unibyte s))=
Why is this needed?=C2=A0 process-send-string already encodes its argument,=
which produces a unibyte string.
> (conceptually; process-send-string also does EOL conversion, which sho= uld never be done for HTTP
> bodies.)
I don't understand why.=C2=A0 There are protocols that require CR-LF, n= o?