From 9676fc497c923931064914adfdf8859c23595568 Mon Sep 17 00:00:00 2001 From: Yuto Hayamizu Date: Fri, 8 Jan 2010 23:35:51 +0900 Subject: [PATCH] bug fix of percent encoding * twittering-mode.el (twittering-percent-encode): bug fix: '\n','\r','\t' were not encoded correctly. --- ChangeLog | 5 +++++ test/test-twittering-mode.el | 6 +++--- twittering-mode.el | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7609ac4b..7182c900 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-01-08 Yuto Hayamizu + + * twittering-mode.el (twittering-percent-encode): bug fix: + '\n','\r','\t' were not encoded correctly. + 2010-01-08 Satoshi Yatagawa * twittering-mode.el (twittering-use-show-minibuffer-length): Add diff --git a/test/test-twittering-mode.el b/test/test-twittering-mode.el index 5413737c..af057ff6 100644 --- a/test/test-twittering-mode.el +++ b/test/test-twittering-mode.el @@ -86,12 +86,12 @@ (defcase test-percent-encode nil nil (test-assert-string-equal "Rinko" (twittering-percent-encode "Rinko")) - (test-assert-string-equal "%25" (twittering-percent-encode "%")) - (test-assert-string-equal "love+plus" - (twittering-percent-encode "love plus"))) + (twittering-percent-encode "love plus")) + (test-assert-string-equal "%0a" + (twittering-percent-encode "\n"))) (with-network (when (require 'url nil t) diff --git a/twittering-mode.el b/twittering-mode.el index 719ec156..a4100ed1 100644 --- a/twittering-mode.el +++ b/twittering-mode.el @@ -1518,7 +1518,7 @@ If STATUS-DATUM is already in DATA-VAR, return nil. If not, return t." ((twittering-url-reserved-p c) (char-to-string c)) ((eq c ? ) "+") - (t (format "%%%x" c)))) + (t (format "%%%02x" c)))) (encode-coding-string str coding-system) ""))