From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.devel Subject: Re: url-retrieve "Multibyte text in HTTP request" error when passing UTF-8 Date: Mon, 15 Jun 2020 00:30:33 +0700 Message-ID: References: <87pna2eksc.fsf@inigo.katxi.org> <87mu56eehq.fsf@inigo.katxi.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="72414"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Dmitry Gutov , =?UTF-8?B?ScOxaWdvIFNlcm5h?= , Emacs developers To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jun 14 19:31:58 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jkWUA-000Ilw-AQ for ged-emacs-devel@m.gmane-mx.org; Sun, 14 Jun 2020 19:31:58 +0200 Original-Received: from localhost ([::1]:51830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jkWU9-0001Dx-Bk for ged-emacs-devel@m.gmane-mx.org; Sun, 14 Jun 2020 13:31:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51870) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jkWT7-00006K-9J for emacs-devel@gnu.org; Sun, 14 Jun 2020 13:30:53 -0400 Original-Received: from mail-vs1-xe2e.google.com ([2607:f8b0:4864:20::e2e]:43454) by eggs.gnu.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jkWT5-0007eB-Hn for emacs-devel@gnu.org; Sun, 14 Jun 2020 13:30:52 -0400 Original-Received: by mail-vs1-xe2e.google.com with SMTP id l10so8046911vsr.10 for ; Sun, 14 Jun 2020 10:30:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VueUxF8bJtmngxWJqTsEh4UUQV8lHjudBsw8Cg/66Sg=; b=HTRYoG+btKC4qrM2q6RYuXn9U6UNbvHmhmvvMzdtKZZ2rW2leej+7RmAPGY2xc+nXi EbmgWqjaaLpUb8C8WfBYot0L7ycWt0YR1NBOorSNyUAl2FFMKmUbVPLN+jYMC2we7iYP ISISKclxbQ/0E7sicZNIjOZZ4+nVrg5AvexOzkDa0ViofFg5YhivC5Lx2Miuyzvn25J6 mV6jbaz0h56Uhj6UEzgzPIBUJ2MQvcpncDds99S+KscBr2KJu6y10uVi18wF+IceRI08 pa2+4Nbxhkc9e2H7AIH9g/R4JS5uD7TA7ILf27aQTkgiidtgVToaWSXtMGkz5oxZMYek xnWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VueUxF8bJtmngxWJqTsEh4UUQV8lHjudBsw8Cg/66Sg=; b=H+q4QCAa2H5ILe5NKWXJEIaqBXNoiizAQwhJURE/c+SGfKqDLQGBHUEc/Gy09Orsvp kYqvUKnKLv5tXuaJVmZBBEAkZf3Pvad4WJoLo42D8zBZBoNqs3qxZzc+5HlGt8uBJvEA Gwd48WpnVbkfEUS5KoYsadeYkXM4WF8WoqAl6qPCFtKahu6ghssQgqx3IXy3SX2TaKWf b1IOUBaq9DO6jdUrVsJTn+eyzX85C9ie6HERLV+BcM8PX81dR6bjGzLwiWnW4brQ65Is YTl9QtV3YpH4AYq3vdAHNOWwVNbIyzRGBy1XlTzG97xyE6oRtjZLCbSe/NgSJCplbQvH bJXw== X-Gm-Message-State: AOAM532oZ4bIjV/FijSF51RX6Md+ovws68oCVB9ngr75gVqmEZ68h2QZ bal6HBEi/vOR3HX7qHug3gC+4zauhKa2jPYc2es= X-Google-Smtp-Source: ABdhPJwWWKo39mi4HGtRkMk+Gcobt+qI+AiE1Sd5+3Rxwee4Y0Q37QXExV8uMW8tBRxoVSMGWFerfdSZdY/arxNCVhI= X-Received: by 2002:a67:f60c:: with SMTP id k12mr16545876vso.139.1592155845142; Sun, 14 Jun 2020 10:30:45 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::e2e; envelope-from=yurivkhan@gmail.com; helo=mail-vs1-xe2e.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:252239 Archived-At: On Sun, 14 Jun 2020 at 20:49, Stefan Monnier wrote: > >> This might beg for some better documentation about the string returned > >> by `json-encode`. After all, AFAIK the JSON format requires utf-8 > >> encoding, so it would make a lot of sense for `json-encode` to do the > >> utf-8 encoding directly and make sure it always returns a unibyte string. > > > > An application might not want to send the encoded string over the > > network right away. It might want to insert it into a buffer. > > I didn't suggest to change the behavior, only to document it because > both outputs can make sense, so common sense is not sufficient to know > what should be returned. Oh, I see. Yes please. More libraries should take care to document their behavior wrt string encodings.