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: Sun, 14 Jun 2020 15:33:04 +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="76593"; 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 10:33:55 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 1jkO5T-000Jq5-74 for ged-emacs-devel@m.gmane-mx.org; Sun, 14 Jun 2020 10:33:55 +0200 Original-Received: from localhost ([::1]:43652 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jkO5S-0006jR-8C for ged-emacs-devel@m.gmane-mx.org; Sun, 14 Jun 2020 04:33:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46616) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jkO4x-0006KL-Bj for emacs-devel@gnu.org; Sun, 14 Jun 2020 04:33:23 -0400 Original-Received: from mail-vs1-xe2b.google.com ([2607:f8b0:4864:20::e2b]:46459) by eggs.gnu.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jkO4v-0001LI-PP for emacs-devel@gnu.org; Sun, 14 Jun 2020 04:33:23 -0400 Original-Received: by mail-vs1-xe2b.google.com with SMTP id k13so7647991vsm.13 for ; Sun, 14 Jun 2020 01:33:16 -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=ud885K12NQyP9/SwdyDWVSUWvsmgo+TZvqtKWn62TPE=; b=GfEnpuoQltlJRXA3pvEucj582hNagn3UDsoy7u61GNIw/Dx+1P8AxAt9igI74yMwgL +aApjyW9SDNlqxEy+FnEHxrB2Qnl85X9XzqMQRyN9EUHD5bu8IgkzUVPhPa1mdMX4wTb 6BvA8Q03Oh1QoVWMQZyE3BPdsEz8XmcGypzsR19fFr/JV4Fe4NrVeVxhqtB3xyxCp2Sr BGOFdt0vK8R6QJNw02XMStrWvYRY7fPkd22CvlDQXSSCNwVWRc/YodxlOFF361N1lZyd lS6Rt2Y57Y9fRVRlJb32bX1diwTlXEJKN3b0nYxeCtyVg3XFK0eB31BfCqCGeLTe7Wca RngA== 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=ud885K12NQyP9/SwdyDWVSUWvsmgo+TZvqtKWn62TPE=; b=ALr3I7+M5fCbO8uciOw4rjgId5rXoSMTxoGQ/rLX8kOe/BbzvzGcxLreVFAYC2FDQ7 Afje9rR+bLiEfvlou5TIbG5pYdBz+B3MWddeU+d0uE7JObGh1DFsKwFUw6OzV7Fllp28 bfHOa4w7D9zveew6kmqTHt5rryxeRa8SNHWpqjoOJxx08kbujJLNuIfp6QU1+igADK+V gRsf6DeZMmdwwVxGnlWJEMqWJIVxRP4fzCJK0Wx9FBIKGlK4PnIuBQA2k3riUD/lvwwW CVjQNYxGs+GREHT3by+OGsZF7Is5v9j/IiJOHIbV+GCtdl4CE9dbMGA01jybJLVYaGOs +iRw== X-Gm-Message-State: AOAM533b3B0Iid41zdQWUYDTpbnmv8ms4jG4MMCXckS5Nn2VLKqdvhtj 5L0aPix7RwzmqZ8nkFIgRobGZtOxJqzPqPzJ8O4= X-Google-Smtp-Source: ABdhPJwbXUm1EUMn5EHRvw0t4RKoba1ynUXV+VfMQ/o9Jm/pk8BJQXMd0LdHLWbA5qqSwz08wRxO2/WvhmUTwu5r1lU= X-Received: by 2002:a67:8a83:: with SMTP id m125mr15958246vsd.199.1592123595758; Sun, 14 Jun 2020 01:33:15 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::e2b; envelope-from=yurivkhan@gmail.com; helo=mail-vs1-xe2b.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:252221 Archived-At: On Sun, 14 Jun 2020 at 07:21, 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. It would make a lot of sense for people who deal with files, sockets and network protocols to also deal with encoding, while people who deal with strings and buffers use JSON-serialized strings transparently.