From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: URL library problem Date: Mon, 03 Oct 2005 10:36:25 -0400 Message-ID: References: <200510022132.54931.pogonyshev@gmx.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1128351502 23417 80.91.229.2 (3 Oct 2005 14:58:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 3 Oct 2005 14:58:22 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 03 16:58:18 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EMRkm-0001ax-KT for ged-emacs-devel@m.gmane.org; Mon, 03 Oct 2005 16:57:21 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EMRkl-0002sM-O9 for ged-emacs-devel@m.gmane.org; Mon, 03 Oct 2005 10:57:19 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EMRj1-0002Gw-Gn for emacs-devel@gnu.org; Mon, 03 Oct 2005 10:55:31 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EMRiy-0002Fj-8c for emacs-devel@gnu.org; Mon, 03 Oct 2005 10:55:29 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EMRhm-0001MP-0o for emacs-devel@gnu.org; Mon, 03 Oct 2005 10:54:14 -0400 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EMRQc-00059E-Qw for emacs-devel@gnu.org; Mon, 03 Oct 2005 10:36:30 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 983572CF5D6; Mon, 3 Oct 2005 10:36:29 -0400 (EDT) Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 85C6D4AC00D; Mon, 3 Oct 2005 10:36:25 -0400 (EDT) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id 67C7AE6C1A; Mon, 3 Oct 2005 10:36:25 -0400 (EDT) Original-To: Paul Pogonyshev In-Reply-To: <200510022132.54931.pogonyshev@gmx.net> (Paul Pogonyshev's message of "Sun, 2 Oct 2005 21:48:06 +0300") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-4.847, requis 5, autolearn=not spam, AWL 0.05, BAYES_00 -4.90) X-MailScanner-From: monnier@iro.umontreal.ca X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:43491 Archived-At: > Note how explicit UTF-8 encoding helps nothing, because `url-request-data' > is later concatenated with some strings turning multibyte again: The problem here is not so much the use of string concatenation but the fact that string concatenation uses string-make-multibyte rather than string-to-multibyte. Another way to look at it and to say that this concatenation should only be done with unibyte strings, so those strings that are concatenated to your string should all be made unibyte. Would the patch below do the trick? Stefan --- orig/lisp/url/url-http.el +++ mod/lisp/url/url-http.el @@ -198,7 +198,11 @@ ;; allows us to elide null lines directly, at the cost of making ;; the layout less clear. (setq request - (concat + (mapconcat + ;; We'd really want here `string-to-unibyte', so as to signal an + ;; error if one of the strings contains a multibyte char. + 'string-as-unibyte + (list ;; The request (or url-request-method "GET") " " (if proxy-obj (url-recreate-url proxy-obj) real-fname) @@ -266,7 +270,8 @@ ;; End request "\r\n" ;; Any data - url-request-data)) + url-request-data) + "")) (url-http-debug "Request is: \n%s" request) request))