Subject: bug#868: [PATCH] Make url-basic-auth support non-ascii passwords

From: Magnus Henoch <[email-masked]>
Date: Tue, 02 Sep 2008 22:52:14 +0200

Package: emacs,url

Just making sure that this doesn't get lost.  Will get to it later...

Subject: [PATCH] Make url-basic-auth support non-ascii passwords
From: İsmail Dönmez <[email-masked]>
To: "emacs- devel" <[email-masked]>
Date: Tue, 26 Aug 2008 19:23:56 +0300
Newsgroups: gmane.emacs.devel
List-Id: "Emacs development discussions." <emacs-devel.gnu.org>

Hi,

url-basic-auth uses base64-encode-string but the password string can
contain non-ascii characters. In which case encode-coding-string
should be used. Attached patch fixes the issue.

Regards,
ismail

-- 
Programmer Excuse #26: I suspect it's a bus collision.
diff --git a/lisp/url/url-auth.el b/lisp/url/url-auth.el
index ce730ce..d089b18 100644
--- a/lisp/url/url-auth.el
+++ b/lisp/url/url-auth.el
@@ -93,7 +93,7 @@ instead of the filename inheritance method."
 		       (cons file
 			     (setq retval
 				   (base64-encode-string
-				    (format "%s:%s" user pass)))))
+				    (format "%s:%s" user (encode-coding-string pass 'utf-8))))))
 		 (symbol-value url-basic-auth-storage))))
      (byserv
       (setq retval (cdr-safe (assoc file byserv)))