Is URI.decode() broken?


#1

e$B$b$m$O$7$G$9!#$$$D$b$@$OC$K$J$C$F$$j$^$9!#e(B

Ruby 1.9.1p0e$B$G!“e(BURI.decode()e$B$,$&$^$/F0$+$J$$$h$&$G$9!#e(B
e$B0lJ8;z$:$D%G%3!<%I$5$l$k$?$ae(B(?)e$B!”%^%k%A%P%$%HJ8;z$rI|85$G$-$F$$$^$;$s!#e(B

$ ruby19 -Ku -ruri -ve ‘p [“e$BF|K\8le(B”.dump, URI.unescape(
URI.escape(“e$BF|K\8le(B”) ).dump]’
ruby 1.9.1p0 (2009-01-30 revision 21907) [i686-darwin9]
[""\u{65e5}\u{672c}\u{8a9e}"",
“”\u{e6}\u{97}\u{a5}\u{e6}\u{9c}\u{ac}\u{e8}\u{aa}\u{9e}""]

1.8.7e$B$G$O$-$A$s$H%G%3!<%I$G$-$F$$$^$9!#e(B

$ $ ruby -Ku -ruri -ve ‘p [“e$BF|K\8le(B”.dump, URI.unescape(
URI.escape(“e$BF|K\8le(B”) ).dump]’
ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-darwin9]
[""\346\227\245\346\234\254\350\252\236"",
“”\346\227\245\346\234\254\350\252\236""]


#2

e$B$J$+$@$G$9!#e(B

At Sat, 14 Feb 2009 12:51:57 +0900,
MOROHASHI Kyosuke wrote in [ruby-dev:38005]:

Ruby 1.9.1p0e$B$G!“e(BURI.decode()e$B$,$&$^$/F0$+$J$$$h$&$G$9!#e(B
e$B0lJ8;z$:$D%G%3!<%I$5$l$k$?$ae(B(?)e$B!”%^%k%A%P%$%HJ8;z$rI|85$G$-$F$$$^$;$s!#e(B

$ ruby19 -Ku -ruri -ve ‘p [“e$BF|K\8le(B”.dump, URI.unescape( URI.escape(“e$BF|K\8le(B”) ).dump]’
ruby 1.9.1p0 (2009-01-30 revision 21907) [i686-darwin9]
[""\u{65e5}\u{672c}\u{8a9e}"",
“”\u{e6}\u{97}\u{a5}\u{e6}\u{9c}\u{ac}\u{e8}\u{aa}\u{9e}""]

UTF-8e$B7h$aBG$A$O$^$:$$$H;W$$$^$9$,!"$3$&$$$&>l9g$C$Fe(B
default_externale$B$G$$$$$s$G$7$g$&$+!#e(B

Index: lib/uri/common.rb

— lib/uri/common.rb (revision 22289)
+++ lib/uri/common.rb (working copy)
@@ -224,9 +224,9 @@ module URI
end
tmp

  •  end
    
  •  end.force_encoding(Encoding::US_ASCII)
    

    end

    def unescape(str, escaped = @regexp[:ESCAPED])

  •  str.gsub(escaped) { [$&[1, 2].hex].pack('U') }
    
  •  str.gsub(escaped) { [$&[1, 2].hex].pack('C') 
    

}.force_encoding(Encoding::default_external)
end


#3

e$B@.@%$G$9!"e(B

Nobuyoshi N. wrote:

“”\u{e6}\u{97}\u{a5}\u{e6}\u{9c}\u{ac}\u{e8}\u{aa}\u{9e}""]

UTF-8e$B7h$aBG$A$O$^$:$$$H;W$$$^$9$,!"$3$&$$$&>l9g$C$Fe(B
default_externale$B$G$$$$$s$G$7$g$&$+!#e(B

e$B4pK\E*$K$O0z?t$N%(%s%3!<%G%#%s%0$,$$$$$N$G$9$+$M$’!#e(B
e$B$G!"e(BUS-ASCII e$B$@$C$?>l9g$Oe(B UTF-8 e$B$G!#e(B

Martin e$B$5$s$I$&;W$o$l$^$9$+!)e(B


#4

xibbare$B$3$HF#2,$G$9!#e(B

$ ruby19 -Ku -ruri -ve ‘p [“e$BF|K\8le(B”.dump, URI.unescape( URI.escape(“e$BF|K\8le(B”) ).dump]’
ruby 1.9.1p0 (2009-01-30 revision 21907) [i686-darwin9]
[""\u{65e5}\u{672c}\u{8a9e}"",
“”\u{e6}\u{97}\u{a5}\u{e6}\u{9c}\u{ac}\u{e8}\u{aa}\u{9e}""]
UTF-8e$B7h$aBG$A$O$^$:$$$H;W$$$^$9$,!"$3$&$$$&>l9g$C$Fe(B
default_externale$B$G$$$$$s$G$7$g$&$+!#e(B

e$B4pK\E*$K$O0z?t$N%(%s%3!<%G%#%s%0$,$$$$$N$G$9$+$M$’!#e(B

e$B$3$A$i$OF10U$G$9$,!"e(B

e$B$G!"e(BUS-ASCII e$B$@$C$?>l9g$Oe(B UTF-8 e$B$G!#e(B

e$B$3$A$i$O=i<*$G$9!#e(B
cgi.rbe$B$NJ}$O0z?t$K$7$F$$$k$N$G$9$,!"e(B
US-ASCIIe$B$N>l9g$Oe(BUTF-8e$B$K$7$F$$$^$;$s!#e(B


#5

NARUSE, Yui e$B$5$s$O=q$-$^$7$?e(B:

e$B$7$+$7!"$A$g$C$H;n$7$F5$IU$$$?$s$G$9$,!"e(B

URI.escape(“http://exmaple.com/foo bar?a=b=c;d=e#hoge#fuga”)
=> “http://exmaple.com/foo%20bar?a=b=c;d=e%23hoge%23fuga
e$B$3$Ne(B # e$B$C$F%(%9%1!<%W$7$A$c$C$F$$$$$s$G$9$+$M$’!#e(B

URI.escapee$B$Oe(BURIe$BJ8K!$K=>$C$F%(%9%1!<%W$9$k$b$N$G$O$J$$$G$9!#e(B
(e$BL>A0$,0-$$$C$F$$$&OC$J$s$G$9$,!D!D!#e(B)


#6

e$B@.@%$G$9!#e(B

Fujioka wrote:

e$B$3$A$i$OF10U$G$9$,!"e(B

e$B$G!"e(BUS-ASCII e$B$@$C$?>l9g$Oe(B UTF-8 e$B$G!#e(B

e$B$3$A$i$O=i<*$G$9!#e(B
cgi.rbe$B$NJ}$O0z?t$K$7$F$$$k$N$G$9$,!"e(B
US-ASCIIe$B$N>l9g$Oe(BUTF-8e$B$K$7$F$$$^$;$s!#e(B

URI e$B$Ne(B percent-encode e$B$ODL>oe(B UTF-8 e$B$G$9$+$i!#e(B
e$B$H$j$"$($:$J$s$G$b$+$s$G$be(B percent-encode e$B$7$F$/$ke(B CGI
e$B$H$O!"e(B
e$B<c43;v>p$,0[$J$k$+$J$H;W$$$^$9!#e(B

e$B$7$+$7!"$A$g$C$H;n$7$F5$IU$$$?$s$G$9$,!"e(B

URI.escape(“http://exmaple.com/foo bar?a=b=c;d=e#hoge#fuga”)
=> “http://exmaple.com/foo%20bar?a=b=c;d=e%23hoge%23fuga
e$B$3$Ne(B # e$B$C$F%(%9%1!<%W$7$A$c$C$F$$$$$s$G$9$+$M$’!#e(B


#7

(2009e$BG/e(B03e$B7ne(B03e$BF|e(B 22:45), NARUSE, Yui
e$B$5$s$O=q$-$^$7$?e(B:

URI.escapee$B$Oe(BURIe$BJ8K!$K=>$C$F%(%9%1!<%W$9$k$b$N$G$O$J$$$G$9!#e(B
e$B$9$k$H!"e(BURI.escape e$B$O$I$N$h$&$J$H$-$K;H$&$Y$-$b$N$J$N$G$7$g$&$+!)e(B

e$B<B:]$N$H$3$m!“e(Bgsube$B$H$+$o$j$J$$$G$9!#e(B
e$B0l1~!“e(BUIRe$BE*e(BUNSAFEe$B$rCV49$9$k$H$$$&$H$3$m$G$O$”$j$^$9$,!“e(B
e$B@5D>$K8@$($P!”$”$^$j9M$($:$K:n$C$F$7$^$C$?$b$N$G$9!#e(B

akre$B$5$s$+$i$h$m$7$/$J$$$H;XE&$5$l$?$s$G$9$,!"J|CV$7$F$7$^$C$F$$$^$9!#e(B


#8

e$B@.@%$G$9!#e(B

akira yamada / e$B$d$^$@$"$-$ie(B wrote:

NARUSE, Yui e$B$5$s$O=q$-$^$7$?e(B:

e$B$7$+$7!"$A$g$C$H;n$7$F5$IU$$$?$s$G$9$,!"e(B

URI.escape(“http://exmaple.com/foo bar?a=b=c;d=e#hoge#fuga”)
=> “http://exmaple.com/foo%20bar?a=b=c;d=e%23hoge%23fuga
e$B$3$Ne(B # e$B$C$F%(%9%1!<%W$7$A$c$C$F$$$$$s$G$9$+$M$’!#e(B

URI.escapee$B$Oe(BURIe$BJ8K!$K=>$C$F%(%9%1!<%W$9$k$b$N$G$O$J$$$G$9!#e(B
(e$BL>A0$,0-$$$C$F$$$&OC$J$s$G$9$,!D!D!#e(B)

e$B$J$k$[$I!#e(B
e$B$9$k$H!"e(BURI.escape
e$B$O$I$N$h$&$J$H$-$K;H$&$Y$-$b$N$J$N$G$7$g$&$+!)e(B


#9

e$B@.@%$G$9!#e(B

2009/09/02 16:24, akira yamada / e$B$d$^$@$"$-$ie(B wrote:

(2009e$BG/e(B03e$B7ne(B03e$BF|e(B 22:45), NARUSE, Yui e$B$5$s$O=q$-$^$7$?e(B:

URI.escapee$B$Oe(BURIe$BJ8K!$K=>$C$F%(%9%1!<%W$9$k$b$N$G$O$J$$$G$9!#e(B
e$B$9$k$H!"e(BURI.escape e$B$O$I$N$h$&$J$H$-$K;H$&$Y$-$b$N$J$N$G$7$g$&$+!)e(B

e$B<B:]$N$H$3$m!“e(Bgsube$B$H$+$o$j$J$$$G$9!#e(B
e$B0l1~!“e(BUIRe$BE*e(BUNSAFEe$B$rCV49$9$k$H$$$&$H$3$m$G$O$”$j$^$9$,!“e(B
e$B@5D>$K8@$($P!”$”$^$j9M$($:$K:n$C$F$7$^$C$?$b$N$G$9!#e(B

akre$B$5$s$+$i$h$m$7$/$J$$$H;XE&$5$l$?$s$G$9$,!"J|CV$7$F$7$^$C$F$$$^$9!#e(B

e$B$U!<$`!"$=$&$@$H$9$k$H!"$=$N$h$&$J%a%=%C%I$,e(B URI.escape e$B$He(B
URI.encode e$B$re(B
e$B2!$5$($F$7$^$C$F$$$k$N$O$$$d$G$9$M$’!#e(B
e$BD94|E*$K$Oe(B encodeURI e$B$"$?$j$HCV$-49$($?$$$H$3$m$G$9$,!"e(B
1.9.2 e$B$GJQ$($A$c$&$N$O$^$:$$$+$J$!!#e(B


#10

In article removed_email_address@domain.invalid,
“NARUSE, Yui” removed_email_address@domain.invalid writes:

e$B$U!<$`!"$=$&$@$H$9$k$H!"$=$N$h$&$J%a%=%C%I$,e(B URI.escape e$B$He(B URI.encode e$B$re(B
e$B2!$5$($F$7$^$C$F$$$k$N$O$$$d$G$9$M$’!#e(B
e$BD94|E*$K$Oe(B encodeURI e$B$"$?$j$HCV$-49$($?$$$H$3$m$G$9$,!"e(B
1.9.2 e$B$GJQ$($A$c$&$N$O$^$:$$$+$J$!!#e(B

e$B$3$NN`$N%a%=%C%I$,J#?tI,MW$J$i!"$=$l$>$l$,$=$N5!G=$rI=8=$9$ke(B
e$B%a%=%C%IL>$r;}$D$Y$-$J$s$8$c$J$$$G$9$+$M$’!#e(B

e$B$@$H$9$l$Pe(B URI.escape e$B$He(B URI.encode
e$B$H$$$&L>A0$O5!G=$rI=8=$Ge(B
e$B$-$F$$$J$$$N$G;H$&$Y$-L>A0$G$O$J$/$F!"$=$N$&$A:o=|M=Dj$H$$$&e(B
e$B$3$H$G7Y9p$rF~$l$k$"$?$j$,$$$$$s$8$c$J$$$G$9$+!#e(B


#11

e$B@.@%$G$9!#e(B

Tanaka A. wrote:

e$B$@$H$9$l$Pe(B URI.escape e$B$He(B URI.encode e$B$H$$$&L>A0$O5!G=$rI=8=$Ge(B
e$B$-$F$$$J$$$N$G;H$&$Y$-L>A0$G$O$J$/$F!"$=$N$&$A:o=|M=Dj$H$$$&e(B
e$B$3$H$G7Y9p$rF~$l$k$"$?$j$,$$$$$s$8$c$J$$$G$9$+!#e(B

e$B$=$&$G$9$M!"$H$j$"$($:7Y9p$r=P$=$&$H;W$$$^$9$,!“e(B
e$B0[8+$N$”$kJ}$O$$$i$C$7$c$$$^$9$+!)e(B


#12

In article removed_email_address@domain.invalid,
“NARUSE, Yui” removed_email_address@domain.invalid writes:

e$BD94|E*$K$Oe(B encodeURI e$B$"$?$j$HCV$-49$($?$$$H$3$m$G$9$,!"e(B

e$B$3$l$,;X$7$F$$$k$N$O!“e(BJavaScript e$B$Ne(B encodeURI
e$B$@$H;W$&$s$G$9e(B
e$B$,!”$=$l$C$F$=$s$J$K$*A&$a$J$s$G$9$+e(B?

ECMAScript Language Specification
http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf

e$B$r8+$k8B$j$Oe(B URI.escape e$B$HF1MM$K!"e(BURI
e$BA4BN$r<u$1IU$1$k$3$H$re(B
e$B0U?^$7$F$$$k$h$&$K;W$($^$9!#$=$&$9$k$H!“6h@Z$j$r0U?^$7$?J8;ze(B
e$B$H%G!<%?$r0U?^$7$?J8;z$,$”$$$^$$$K$J$C$F!“0U?^$K$”$C$?%(%9%1!<e(B
e$B%W$,$G$-$^$;$s!#e(B

e$B$?$H$($P!"e(BGoogle (e$BEEBne(B) e$B$Ge(B 2+3
e$B$H$$$&<0$r7W;;$5$;$k$h$&$Je(B
URI e$B$r!"0J2<$N$h$&$K@8@.$7$F$b$&$^$/$$$-$^$;$s!#e(B

expr = “2+3”
puts URI.escape(“http://www.google.com/search?q=#{expr}”)
#=> http://www.google.com/search?q=2+3

e$B$&$^$/$$$+$J$$$N$O!"e(B+ e$B$,e(B +
e$B$N$^$^$@$+$i$G$9!#$&$^$/$$$+$;$ke(B
e$B$K$O!"e(B+ e$B$re(B %2B e$B$K$7$J$$$H$$$1$J$$$N$G$9$,!“e(Bexpr
e$BFb$Ne(B + e$B$re(B
%2B e$B$K$7$F$b!”$d$C$Q$j$&$^$/$$$-$^$;$s!#e(B

expr = “2%2B3”
puts URI.escape(“http://www.google.com/search?q=#{expr}”)
#=> http://www.google.com/search?q=2%2B3

e$B$?$V$s!“e(BJavaScript e$B$Ne(B encodeURI
e$B$bF1$8LdBj$,$”$k$G$7$g$&!#e(B

e$B$3$N$h$&$K$&$^$/$$$+$J$$$N$O8D!9$NMWAG$rO"7k$7$F$+$i%(%9%1!<e(B
e$B%W$9$k$H$$$&9M$(J}$,4V0c$C$F$$$k$+$i$G!"@5$7$/$O8D!9$NMWAG$re(B
e$B%(%9%1!<%W$7$F$+$iO"7k$9$kI,MW$,$"$j$^$9!#e(B

e$B$J$N$G!“e(BURI (e$B$C$]$/8D!9$NMWAG$rO"7k$7$?$b$Ne(B)
e$B$r%(%9%1!<%W$9e(B
e$B$k$H$$$&4X?t$O9M$(J}<+BN$,4V0c$C$F$$$F!”$H$F$b$*A&$a$G$-$k$be(B
e$B$N$G$O$J$$$H;W$&$s$G$9$,!#e(B

e$B$D$^$j!"$H$F$b$8$c$J$$$G$9$,;H$$$d$9$$$H$3$m$K$"$k$Y$-5!G=$He(B
e$B$O;W$($J$$$N$G!"e(BencodeURI e$B$re(B URI.escape e$B$de(B URI.encode
e$B$J$I;He(B
e$B$$$d$9$$L>A0$K3d$jEv$F$k$3$H$K$OH?BP$7$^$9!#e(B


#13

In article removed_email_address@domain.invalid,
“NARUSE, Yui” removed_email_address@domain.invalid writes:

e$B$U$`!"$9$k$H!Ve(BURI.escape e$B$OMQ0U$7$J$$!W$,@52r$K$J$k$N$G$9$+$M!#e(B

URI.escape e$B$K$D$$$F$O$=$&;W$$$^$9!#e(B

e$B$G!"e(BURI.build( … ).to_s e$B$r4pK$H$7!"7Y9p$GM6F3$9$k$H$+!#e(B

e$B8D?ME*$Ke(B URI.build e$B$r;H$C$?7P83$,$J$$$s$G$9$,!"$h$/$"$kMQK!e(B
e$B$K9g$C$F$k$s$G$9$+$M$'e(B?

e$B$H$j$"$($:e(B Google Code Search e$B$G$O$R$H$D;H$C$F$$$k$H$3$m$,$“e(B
e$B$j$^$7$?$,!”$H$F$b>/$J$$5$$,$7$^$9!#e(B

e$B$@$l$b;H$C$F$$$J$$$1$l$I!"<B$O$3$l$,NI$$$N$@!"$H<gD%$9$k$3$He(B
e$B$,IT2DG=$H$O$$$$$^$;$s$,!"K\Ev$K$=$l$,NI$$$+$I$&$+$r<B:]$NMQe(B
e$BK!$KB’$7$F9M$($k$N$,@h$J$s$8$c$J$$$G$7$g$&$+!#e(B

e$B$7$+$7!"$=$&$9$k$H!"e(BURI.build e$B$,B?8@8l%I%a%$%sBP1~$O$*$m$+!“e(B
path e$B$de(B query e$B$K;j$k$^$G$”$i$+$8$ae(B escape e$B$5$l$F$$$k$3$H$re(B
e$B5a$a$F$$$k$N$O>/!9ITJX$G$9$M$’!#e(B

e$B$7$+$7!"$=$&$9$k$H!"e(B"http://e$BF|K\8le(B.jp/"e$B$rJV$9%a%=%C%I$H!"e(B
"http://日本語.jp/"e$B$rJV$9%a%=%C%I$NFs$D$,I,MW$J$N$@$J!#e(B

e$B;d$O!“Hse(BASCII e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,!#e(B

e$B$7$+$7!"$=$&$9$k$H!"e(BURI.build e$B$,B?8@8l%I%a%$%sBP1~$O$*$m$+!“e(B
path e$B$de(B query e$B$K;j$k$^$G$”$i$+$8$ae(B escape
e$B$5$l$F$$$k$3$H$re(B
e$B5a$a$F$$$k$N$O>/!9ITJX$G$9$M$’!#e(B

e$B$7$+$7!"$=$&$9$k$H!"e(B"http://e$BF|K\8le(B.jp/"e$B$rJV$9%a%=%C%I$H!"e(B
"http://日本語.jp/"e$B$rJV$9%a%=%C%I$NFs$D$,I,MW$J$N$@$J!#e(B


#15

e$B>.:j!w;W$$$D$-$rE,Ev$K=q$$$F$_$k%F%9%He(B

e$B$H%G!<%?$r0U?^$7$?J8;z$,$"$$$^$$$K$J$C$F!“0U?^$K$”$C$?%(%9%1!<e(B
e$B%W$,$G$-$^$;$s!#e(B

APIe$B$H$7$F$N6Z$NNI$5$H$OJLN)$F$H$7$F!“e(Bjavascripte$B$Ge(Bencode or
decodee$B$9$k$N$Ge(B
e$B$^$C$?$/F1$8;HMQ$Ne(Bencocde/decodee$B4X?t$,e(BRubye$B$K$b$”$k$H$&$l$7$$!#e(B
e$B$H$$$&$N$O$"$k$+$be(B

e$B$"$H!“e(BencodeURIComponent()e$B$O!”$=$NL>$NDL$je(BURIe$B$N8D!9$N%3%s%]!<%M%s%H$re(B
e$B0z?t$K<h$k;v$rG0F,$K$*$$$?4X?t$G!"e(Bjavascripte$B$G$Oe(BStringe$B7?$7$+$J$$$+$i!“e(B
URIe$B$r%3%s%]!<%M%s%H$KJ,3d$9$k@UL3$rMxMQ<T$KEj$2$F$$$k!#e(B
URIe$B7?$r:n$k$J$i!”$b$&$A$g$C$H%$%s%F%j%8%’%s%H$K$d$C$FM_$7$$$H$$$&5$$b$7$J$/$O$J$$$+$b!#e(B
e$B$h$/CN$i$J$$$1$I!“e(BURI.split()e$B$,$”$k$+$i$K$O!"e(BURIe$B$N9=B$$r$7$C$F$k%/%i%9$J$s$G$9$h$M!)$3$N?M!#e(B

e$B0J2<!"M>CLe(B
e$B$9$G$K5-21$,$*$$m$2$J$N$G$9$,e(B
escape()e$B4X?t$@$1$O:Y$+$$;EMM$,e(B
e$B%V%i%&%6Kh$K0c$C$?$H;W$&$N$GMQ0U$7$J$$$[$&$,$h$$$+$b!#e(B
e$B5-21$,@5$7$1$l$P!"e(Bescape()e$B$,5sF0%P%i%P%i$@$C$?$N$G!“e(BECMAScripte$B$Ne(B
e$B5,3J$+$ie(Bescape()e$B$,Mn$A$F!“e(BencodeURI() e$B$He(B
encodeURIComponent()e$B$,e(B
e$BDI2C$5$l$?!”$H$$$&;~7ONs$N$O$:!#e(B
e$B%$%^%I%-$O5sF0E}0l$5$l$F$k$N$+$b$7$l$J$$$,!”$=$l$bL$8!>Ze(B


#16

In article removed_email_address@domain.invalid,
KOSAKI Motohiro removed_email_address@domain.invalid writes:

APIe$B$H$7$F$N6Z$NNI$5$H$OJLN)$F$H$7$F!“e(Bjavascripte$B$Ge(Bencode or decodee$B$9$k$N$Ge(B
e$B$^$C$?$/F1$8;HMQ$Ne(Bencocde/decodee$B4X?t$,e(BRubye$B$K$b$”$k$H$&$l$7$$!#e(B
e$B$H$$$&$N$O$"$k$+$be(B

encodeURI e$B$N=PNO$+$i!"F~NO$rF@$k$K$O!"L5:9JL$Ke(B %-encoding e$B$re(B
e$B2r$1$P$$$$$N$G!"e(BdecodeURI
e$B$G$J$/$F$b$$$$$s$8$c$J$$$G$7$g$&$+!#e(B
decodeURIComponent e$B$G$b$$$$$G$9$7!"e(BCGI.unescape e$B$G$b$+$^$$$^e(B
e$B$;$s!#e(B

decodeURI e$B$O!“e(BencodeURI e$B$,@8@.$9$ke(B %-encoding
e$B$O$9$Y$F2r$-$^e(B
e$B$9$,!”$=$&$G$J$$e(B %-encoding e$B$r0lIt2r$+$J$$$3$H$,$"$k$h$&$G$9e(B
e$B$,!"$3$l$O2?$NLr$KN)$D$N$+$J$!e(B?
(e$BNc$($P!“e(BdecodeURI(”%40") e$B$,e(B “%40” e$B$K$J$k$H$+!#e(B)

e$B$"$H!“e(BencodeURIComponent()e$B$O!”$=$NL>$NDL$je(BURIe$B$N8D!9$N%3%s%]!<%M%s%H$re(B
e$B0z?t$K<h$k;v$rG0F,$K$*$$$?4X?t$G!"e(Bjavascripte$B$G$Oe(BStringe$B7?$7$+$J$$$+$i!“e(B
URIe$B$r%3%s%]!<%M%s%H$KJ,3d$9$k@UL3$rMxMQ<T$KEj$2$F$$$k!#e(B
URIe$B7?$r:n$k$J$i!”$b$&$A$g$C$H%$%s%F%j%8%’%s%H$K$d$C$FM_$7$$$H$$$&5$$b$7$J$/$O$J$$$+$b!#e(B
e$B$h$/CN$i$J$$$1$I!“e(BURI.split()e$B$,$”$k$+$i$K$O!"e(BURIe$B$N9=B$$r$7$C$F$k%/%i%9$J$s$G$9$h$M!)$3$N?M!#e(B

encodeURIComponent e$B$O4pK\E*$J9M$(J}$H$7$F$O0-$/$J$$$H;W$$$^e(B
e$B$9!#e(B! e$B$J$I$,$=$N$^$^$J$N$O4E$$$H;W$$$^$9$,!"8E$$e(B RFC
e$B$N1F6Ae(B
e$B$G$7$g$&$M!#:#$@$C$?$ie(B unreserved e$B0J30$r0lN’$Ke(B %-encoding
e$B$Ke(B
e$B$7$F$7$^$&$N$,$$$$$G$7$g$&!#e(B

URI e$B%/%i%9$,e(B URI
e$B$N9=B$$rCN$C$F$$$k$N$O$=$N$H$*$j$J$s$G$9$,!"e(B
e$BLdBj$Oe(B URI e$B$N0UL#$,$$$m$$$m$HJ8L.0MB8$J$H$3$m$G$9$M!#e(B

e$B$?$H$($P!“e(BHTTP URI e$B$Ne(B query e$B$N0UL#$O!”<u$1<h$ke(B web
application e$B$NF0:n$K0MB8$7$^$9!#$?$H$($P!“e(B& e$B$He(B %26
e$B$rF10l;ke(B
e$B$7$F$$$$$+!”$=$&$G$J$$$N$+$O!"e(Bweb application
e$B$NF0:n<!Bh$G$9!#e(B

e$B$=$&$$$&$o$1$G!"e(BURI e$B%/%i%9$K$O!“e(B& e$B$He(B %26
e$B$r6hJL$7$F;XDj$G$-e(B
e$B$ke(B API e$B$,I,MW$G$9!#$=$&$$$&e(B API e$B$H$7$F!“J8;zNs$Ne(B “&”
e$B$He(B
“%26” e$B$r<u$1EO$9$b$N$,;H$o$l$F$$$k$H$$$&$N$,8=>u$G$7$g$&!#e(B
e$B$D$^$j!”%(%9%1!<%W:Q$_$N$b$N$rEO$9!”$H$$$&$3$H$G$9!#e(B

e$B%$%s%F%j%8%’%s%H!"$H$$$&$N$r%"%W%j%1!<%7%g%sB&$G%(%9%1!<%W$7e(B
e$B$J$/$F$h$$!"$HFI$_$+$($k$H!“2?$r%(%9%1!<%W$9$Y$-$+$H$$$&$H$3e(B
e$B$m$r$I$3$+$GJd40$7$F$”$2$J$$$H$$$1$^$;$s!#e(B

e$B$?$H$($P!“e(BURI.escape_component e$B$H$$$&$N$r9M$($F!”%3%s%]!<%Me(B
e$B%s%H$H$7$F%(%9%1!<%W$9$k$H$$$&%a%=%C%I$H$9$k$H!"6h@Z$jJ8;z$Ke(B
e$B$J$j$&$kJ8;z$r$<$s$V%(%9%1!<%W$9$k$3$H$K$J$j$^$9!#e(B
(URI e$B$KF~$l$i$l$J$$J8;z$b%(%9%1!<%W$7$J$$$H$$$1$J$$$N$G!"7ke(B
e$B6Ie(B unreserved e$B0J30$r%(%9%1!<%W$9$k$N$,E,@Z$G$7$g$&$,e(B)

e$B$"$k$$$O!"e(BURI.escape_html_form([[k1, v1], [k2, v2], …]) e$B$He(B
e$B$$$&%a%=%C%I$,!"e(Bapplication/x-www-form-urlencoded e$B$K=>$C$Fe(B
(e$B%(%9%1!<%W$7$Fe(B) k1=v1&k2=v2&… e$B$H$$$&7A<0$r@8@.$9$k%a%=%Ce(B
e$B%I$@$H$9$k$H!"e(Bk, v e$B$NCf$G$O!“e(Bquery e$B$K;H$($J$$J8;z$He(B =,
& e$B$re(B
e$B%(%9%1!<%W$9$k$3$H$K$J$j$^$9!#e(B(e$B$”$He(B + e$B$He(B ;
e$B$b$+$Je(B)

URI.escape_component e$B$K$7$F$be(B URI.escape_html_form
e$B$K$7$F$b!“e(B
e$B%a%=%C%IL>$,2?$r%(%9%1!<%W$9$Y$-$+$H$$$&$H$$$&0UL#$r;XDj$7$Fe(B
e$B$$$F!”$I$&$$$&e(B API e$B$K$;$h$3$l$HF1Ey$J;XDj$O$I$3$+$G$7$J$$$He(B
e$B$$$1$J$$$o$1$G$9!#$J$N$G!"$=$&$$$&;XDj$r$I$N$/$i$$4J7i$K$G$-e(B
e$B$k$+$,%$%s%F%j%8%’%s%H$K;W$($ke(B API e$B$N80$G$7$g$&$+!#e(B


#17

Tanaka A. wrote:

e$B$G!"e(BURI.build( … ).to_s e$B$r4pK$H$7!"7Y9p$GM6F3$9$k$H$+!#e(B

e$B8D?ME*$Ke(B URI.build e$B$r;H$C$?7P83$,$J$$$s$G$9$,!"$h$/$"$kMQK!e(B
e$B$K9g$C$F$k$s$G$9$+$M$'e(B?

e$B8=>u$G$O$"$C$F$$$^$;$s$M!#e(B
host e$B$de(B path e$B$O%(%9%1!<%W:Q$$G$J$1$l$P$$$1$^$;$s$7!"e(B
query e$B$b7k9g:Q$
$G$J$$$H$$$1$J$$$N$G!#e(B

e$B$H$j$"$($:e(B Google Code Search e$B$G$O$R$H$D;H$C$F$$$k$H$3$m$,$“e(B
e$B$j$^$7$?$,!”$H$F$b>/$J$$5$$,$7$^$9!#e(B

e$B$h$/$"$kMQK!$G$O!“e(Bprotocol-host-path e$B$”$?$j$^$G$O!"e(B
e$B$$$-$J$jJ8;zNs$H$7$FM/$$$F=P$FMh$F$$$k$h$&$J5$$,$7$^$9!#e(B

e$B:#2s$NOC$O$=$NH]Dj$+$i;O$^$C$F$$$k$N$G$I$&$J$s$G$7$g$&$M!#e(B
e$B$3$NItJ,$K$D$$$F0lDj$N2>Dj$rCV$1$k$J$i$P!"$^$?JL$Ne(BAPIe$B$NM>CO$,$"$j$^$9$,!#e(B

e$B;d$O!“Hse(BASCII e$B$Je(B URI e$B$r;H$C$?3P$($,$”$^$j$"$j$^$;$s!#e(B
(query e$BItJ,$K;H$C$?$3$H$O2?2s$+$"$k5$$,$7$^$9$,!#e(B)

e$B$=$N$?$a!"MQK!$rA[A|$9$k$3$H$,;d$K$O:$Fq$G$9!#$$$-$J$j$=$NFse(B
e$B$D$,I,MW$@$H$$$o$l$F$b$J$s$H$b!#e(B

e$BB?8@8l%I%a%$%s0J30$@$H!"<B<AE*$Ke(B query e$B$J5$$b$7$^$9$,Nc$($Pe(B
Wikipedia e$B$H$+!#e(B

IRI: http://ja.wikipedia.org/wiki/e$B$^$D$b$H$f$-$R$me(B
URI:
http://ja.wikipedia.org/wiki/まつもとゆきひろ

e$B$3$l$K%"%/%;%9$7$h$&$H;W$C$?$j!"e(Ba e$BMWAG$Ne(B href
e$BB0@-$K;H$C$?$j$9$k$J$i$Pe(B
URI e$B$NJ}$r;H$&$N$G$7$g$&$,!“e(B
e$B$3$N%”%I%l%9<+BN$rI=<($7$?$$>l9g$Oe(B IRI e$B$NJ}$r;H$&$H$+!#e(B

e$B$^$!!"e(BIRI e$B$r%5%]!<%H$7$h$&$H;W$&$He(B NFC e$B$de(B Punycode
e$B$,I,MW$K$J$k$N$G!"e(B
e$B8=;~E@$G$O%5%]!<%H$7$h$&$h!*$H$$$&OC$G$O$J$$$G$9!#e(B

% e$B$rJQ$($J$$%(%9%1!<%W!"$H$$$&%"%$%G%"$,$J$/$b$J$$$N$G$9$,!“e(B
e$BMQK!$,$o$+$i$J$$$N$G!”$&$^$/;H$($k$+$I$&$+$OITL@$G$9!#e(B

IRI e$B$NOC$r;}$A=P$7$?$N$O<B$O$3$A$i8~$1$G!“e(BURI
e$B$C$]$$J8;zNsA4BN$K$+$1$k%(e(B
e$B%9%1!<%W$O!“e(B
e$B4pK\E*$K$Oe(B IRI e$B$+$ie(B URI
e$B$X$NJQ49$G$”$k$Y$-$G$O$J$$$N$+!”$H;W$&$h$&$K$J$je(B
e$B$^$7$?!#e(B
http://tools.ietf.org/html/rfc3987#section-3.1
e$B$3$A$i$Oe(B US-ASCII e$B$NHO0O30$7$+$$$8$i$J$$$N$G!"$4;XE&$Ne(B
%-encode e$B$N2a>jE,e(B
e$BMQLdBj$,$"$j$^$;$s!#e(B

e$B$^$?!“e(BURL e$B$C$]$$$b$N$re(B URI e$B$KJQ49$9$k<jB3$-$re(B HTML 5
e$B$N?M!9$,9M$($F$$$^$9!#e(B
http://www.w3.org/html/wg/href/draft
e$B$3$A$i$O8=>ue(B %-encode
e$B$N2a>jE,MQ$NLdBj$,$”$k$N$G!"$=$NE@$O$D$C$D$$$F$_$he(B
e$B$&$+$J$H!#e(B


#18

On Tue, 8 Sep 2009 11:56:21 +0900
In article removed_email_address@domain.invalid
[[ruby-dev:39254] Re: Is URI.decode() broken?]
“NARUSE, Yui” removed_email_address@domain.invalid wrote:

e$B$^$!!"e(BIRI e$B$r%5%]!<%H$7$h$&$H;W$&$He(B NFC e$B$de(B Punycode e$B$,I,MW$K$J$k$N$G!"e(B
e$B8=;~E@$G$O%5%]!<%H$7$h$&$h!*$H$$$&OC$G$O$J$$$G$9!#e(B

e$B0l1~!"e(Brubygemse$B$K!“e(Blibidne$B$r;H$C$?e(Bidn
geme$B$,$”$j$^$9!#e(B

irb(main):001:0> require ‘rubygems’
irb(main):002:0> require ‘idn’

irb(main):005:0> IDN::Idna.toASCII(‘e$B$k$S$$!##O#R#Ge(B’)
=> “るびい.org
irb(main):008:0> IDN::Idna.toUnicode(‘るびい.org’)
=> “e$B$k$S$$e(B.org


#19

e$B$;$s!#e(B
e$B$J$k$[$I!#F10U$7$^$9!#e(B

decodeURI e$B$O!“e(BencodeURI e$B$,@8@.$9$ke(B %-encoding e$B$O$9$Y$F2r$-$^e(B
e$B$9$,!”$=$&$G$J$$e(B %-encoding e$B$r0lIt2r$+$J$$$3$H$,$"$k$h$&$G$9e(B
e$B$,!"$3$l$O2?$NLr$KN)$D$N$+$J$!e(B?
(e$BNc$($P!“e(Bdecode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%$%s%F%j%8%’%s%H$K;W$($ke(B API e$B$N80$G$7$g$&$+!#e(B

e$B$@$$$?$$<q;]$OJ,$+$j$^$7$?!#e(B
e$B>e5-Nc$Ne(BURI.escape_html_form()e$B$O8+$k$+$i$K;H$$$K$/$$$N$Ge(B
e$B$3$l$@$C$?$i$J$$J}$,$$$$$H;W$$$^$9!#e(B
e$B$G!";H$$$d$9$5$r9M$($k$H!"$b$C$H>e0L%l%$%d!"e(Bkeye$B$He(Bvaluee$B$G%b%N$r9M$($F$$$ke(B
e$B%l%$%d$G%(%9%1!<%W$7$J$$$H;H$$$d$9$5$,8~>e$7$J$$!#$H$$$&<gD%$@$He(B
e$B<u$1$H$a$^$7$?!#e(B

e$B$H9M$($k$H!"%(%9%1!<%W$Oe(BRoRe$B$N$h$&$J%l%$%d$G%U%)%m!<$7$F$"$2$k$N$,e(B
e$B$h$$$h$&$J5$$b$7$^$9$M!#e(B
e$B%3%"%i%$%V%i%j$G$O!“e(B{encode/decode}URIComponent(string)
e$B$C$]$$$b$N$@$1$re(B
e$BMQ0U$7$F$”$2$k$N$,$$$$$N$+!"$^$C$?$/MQ0U$7$J$$$[$&$,$$$$$N$+$O$A$g$C$He(B
e$BH=CG$,$D$-$^$;$s$,!#e(B

e$B$(!<$H!"$9$$$^$;$s!#$A$g$C$HE;$^$C$F$$$J$$$N$G$9$,!"@h$N%a!<%k$N%"%$%G%"$O6Z0-$C$]$$e(B
e$BJ70O5$$J$N$G<h$j>C$5$;$F$/$@$5$$!#e(B
e$B$$$$F,$NBNA`$K$J$j$^$7$?!#e(B


#20

In article removed_email_address@domain.invalid,
KOSAKI Motohiro removed_email_address@domain.invalid writes:

decodeURI e$B$O!“e(BencodeURI e$B$,@8@.$9$ke(B %-encoding e$B$O$9$Y$F2r$-$^e(B
e$B$9$,!”$=$&$G$J$$e(B %-encoding e$B$r0lIt2r$+$J$$$3$H$,$"$k$h$&$G$9e(B
e$B$,!"$3$l$O2?$NLr$KN)$D$N$+$J$!e(B?
(e$BNc$($P!“e(BdecodeURI(”%40") e$B$,e(B “%40” e$B$K$J$k$H$+!#e(B)

e$B$A$g$C$H$D$$$F$$$1$J$+$C$?$N$GJ]N1!#e(B
e$B!J$?$V$s!"e(Brubye$BFCM-$NOC$J$s$@$H?dB,!Ke(B

e$B$$$d!"e(BJavaScript e$B$G$9!#e(B

% js
js> decodeURI("%40")
%40
js> decodeURI("%41")
A
js> decodeURI("%25")
%
js>

e$B$(!<$H!"<j85$N%^%7%s$Ge(B js e$B$N<BBN$Oe(B /usr/bin/smjs e$B$G!"e(B
spidermonkey-bin - standalone JavaScript/ECMAScript (ECMA-262)
interpreter
e$B$H$$$&$b$N$N$h$&$G$9!#e(B

% js --version
JavaScript-C 1.8.0 pre-release 1 2009-02-16
usage: js [-zKPswWxCi] [-b branchlimit] [-c stackchunksize] [-o option]
[-v version] [-f scriptfile] [-e script] [-S maxstacksize] [scriptfile]
[scriptarg…]

e$B$=$&$G$9$M!#F10U$7$^$9!#e(B
e$BM}G0$H$7$F$OJ8L.Hs0MB8$J$O$:$@$C$?$N$G$9$,!"8=<B$Ne(BWebe$B$G$Oe(B
e$BFC$Ke(BHTTPe$B$K$*$$$F!"9-$/J8L.0MB8$K$J$C$F$$$^$9$M!#e(B

e$B$$$d!"e(BURI e$B$H$$$&$N$O!“e(Breserved
e$B$JJ8;z$N=89g$K3F%9%-!<%$Ge(B (e$B>e0L$G;H$C$F$$$k$N$H>WFM$7$J$$J8;z$Ke(B) e$B0UL#$r3d$jEv$F$F$$$/e(B e$B$H$$$&%7%9%F%$J$N$G!”$b$H$b$H0UL#$N3d$jEv$F$O>u67$K$h$C$F0[e(B
e$B$J$k$b$N$J$s$G$9!#e(B

HTTP e$B$N>l9g!"%(%9%1!<%W:Q$_$J$b$N$,%W%m%H%3%k$GDL?.$5$l$k$Ne(B
e$B$G!"e(BHTTP e$B$H$$$&%9%-!<%`$,$5$i$K3Fe(B web application
e$B$J$I$K0UL#e(B
e$B$N3d$jEv$F$r0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