all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: URL library problem
Date: Mon, 03 Oct 2005 10:36:25 -0400	[thread overview]
Message-ID: <jwv3bniadhx.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <200510022132.54931.pogonyshev@gmx.net> (Paul Pogonyshev's message of "Sun, 2 Oct 2005 21:48:06 +0300")

> 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))

  parent reply	other threads:[~2005-10-03 14:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-02 18:48 URL library problem Paul Pogonyshev
2005-10-02 19:32 ` Mark A. Hershberger
2005-10-03  5:09 ` Richard M. Stallman
2005-10-03 14:36 ` Stefan Monnier [this message]
2005-10-03 15:26   ` Stefan Monnier
2005-10-03 17:53     ` Paul Pogonyshev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwv3bniadhx.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.