# Backporting URI to ruby\_1\_8

**URL:** <https://www.ruby-forum.com/t/backporting-uri-to-ruby-1-8/85544>\
**Category:** Development\
**Created:** [February 14, 2007, 2:07pm UTC](https://www.ruby-forum.com/t/backporting-uri-to-ruby-1-8/85544 "2007-02-14T14:07:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Akinori\_MUSHA](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/b782af/32.png) [@Akinori\_MUSHA](https://www.ruby-forum.com/u/Akinori_MUSHA)\
**Post date:** [February 14, 2007, 2:07pm UTC](https://www.ruby-forum.com/t/backporting-uri-to-ruby-1-8/85544/1 "2007-02-14T14:07:24Z")

</div>

e$B!!e(Blib/uri e$B$re(B trunk e$B$+$ie(B ruby\_1\_8  
e$B$K%^!\<%8$7$^$9!#e(B

e$B!!$^$:!"e(B userinfo e$B$K4X$9$k%P%0=$@5$He(BFTPe$B%9%-!\<%`$Ne(B path  
e$B$K4X$9$ke(B  
e$B=$@5$K0[O@$O$J$$$H;W$$$^$9!#e(B

e$B!!e(BURI.escape() e$B$He(B URI.unescape()  
e$B$NBhFs0z?t$KJ8;zNs$rEO$7$?\>l9g$Ne(B  
e$B5sF0$NJQ99$G$9$,!"Hs8\_49$O\>7$-$^$9$,0J2\<$NM}M3$G\<h$j9~$`$Y$-$He(B  
e$B9M$($^$7$?!#e(B

- Regexp.new(Regexp.quote(unsafe), false, “N”) e$B$H$J$C$F$$$k$,!“e(B  
e$B$3$l$G$O0lJ8;z$7$+EO$;$J$$$N$GJ8;z=89g$r;XDj$G$-$:!”;v**ee(B  
e$BLr$KN)$?$J$$!#$D$^$j!“\<BAu$^$?$O;EMM$N%P%0$G$”$k!#e(B  
cf. [ruby-dev:27692]**

 **- rdoc ##e$B$OBhFs0z?t$Oe(B Regexp  
e$B$H=q$$$F$"$j!"J8;zNs$r\<u$1IU$1$ke(B  
e$B$3$H$OL@J82=$5$l$?;EMM$G$O$J$$!#e(B**

 
 

e$B!!%U%j!\<%:A0$KF~$l$k$D$b$j$G$9$N$G!“$b$7LdBj$,$”$l$P;XE&$N$[$Ie(B  
e$B$\*4j$$$7$^$9!#e(B

–  
/  
/\_\_ \_\_ [Akinori.org](http://Akinori.org) / [MUSHA.org](http://MUSHA.org)  
/ ) ) ) ) / [FreeBSD.org](http://FreeBSD.org) / [Ruby-lang.org](http://Ruby-lang.org)  
Akinori MUSHA aka / (\_ / ( (\_\_( @ [iDaemons.org](http://iDaemons.org) / and.or.jp

“Different eyes see different things,  
Different hearts beat on different strings –  
But there are times for you and me when all such things agree”

---

<div class="post-metadata">

**Author:** ![Akinori\_MUSHA](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/b782af/32.png) [@Akinori\_MUSHA](https://www.ruby-forum.com/u/Akinori_MUSHA)\
**Post date:** [February 15, 2007, 7:09am UTC](https://www.ruby-forum.com/t/backporting-uri-to-ruby-1-8/85544/2 "2007-02-15T07:09:26Z")

</div>

e$B@\>;3OB9-$G$9!#e(B

> > > > > On Wed, 14 Feb 2007 22:06:05 +0900  
> > > > > removed\_email\_address@domain.invalid(“Akinori MUSHA”) said:
> 
> e$B!!e(Blib/uri e$B$re(B trunk e$B$+$ie(B ruby\_1\_8 e$B$K%^!\<%8$7$^$9!#e(B
> 
> e$B!!$^$:!"e(B userinfo e$B$K4X$9$k%P%0=$@5$He(BFTPe$B%9%-!\<%`$Ne(B path e$B$K4X$9$ke(B  
> e$B=$@5$K0[O@$O$J$$$H;W$$$^$9!#e(B

userinfo e$B$K4X$9$k%P%0=$@5$H$$$&$N$Oe(B[ruby-core:10290]e$B$Ne(B  
e$B6u$N%f!\<%6L\>$N\>l9g$K%Q%9%o!\<%I$rL5;k$9$k$h$&$K$9$k$He(B  
e$B$$$&;v$G$7$g$&$+e(B?

[http://www.sic.med.tohoku.ac.jp/~mladmin/w3m-dev/200001.month/281.html](http://www.sic.med.tohoku.ac.jp/~mladmin/w3m-dev/200001.month/281.html)  
e$B$K$“$k$h$&$K6u$N%f!\<%6L\>$,;H$o$l$k$3$H$b$”$k$N$G!“e(B  
e$B:#$N5sF0$NJ}$,NI$$$H;W$&$N$G$9$,!”$I$&$G$7$g$&$+e(B?

---

<div class="post-metadata">

**Author:** ![Akinori\_MUSHA](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/b782af/32.png) [@Akinori\_MUSHA](https://www.ruby-forum.com/u/Akinori_MUSHA)\
**Post date:** [February 15, 2007, 8:02am UTC](https://www.ruby-forum.com/t/backporting-uri-to-ruby-1-8/85544/3 "2007-02-15T08:02:29Z")

</div>

At Thu, 15 Feb 2007 15:08:28 +0900,  
Kazuhiro NISHIYAMA wrote:

> userinfo e$B$K4X$9$k%P%0=$@5$H$$$&$N$Oe(B[ruby-core:10290]e$B$Ne(B  
> e$B6u$N%f!\<%6L\>$N\>l9g$K%Q%9%o!\<%I$rL5;k$9$k$h$&$K$9$k$He(B  
> e$B$$$&;v$G$7$g$&$+e(B?

e$B!!$“!”%Q%C%A$N\<q;]$r4\*0c$$$7$F$$$^$7$?!#e(B

e$B!!e(Bruby\_1\_8 e$B$G$O$$$C$?$sLa$7$^$9!#e(B

> [http://www.sic.med.tohoku.ac.jp/~mladmin/w3m-dev/200001.month/281.html](http://www.sic.med.tohoku.ac.jp/~mladmin/w3m-dev/200001.month/281.html)  
> e$B$K$“$k$h$&$K6u$N%f!\<%6L\>$,;H$o$l$k$3$H$b$”$k$N$G!“e(B  
> e$B:#$N5sF0$NJ}$,NI$$$H;W$&$N$G$9$,!”$I$&$G$7$g$&$+e(B?

e$B!!$o$6$o$6JRJ}$@$16u$K$7$F$$$k$N$@$+$i$=$N$^$^$G$$$$5$$,$7$^$9$M!#e(B

–  
/  
/\_\_ \_\_ [Akinori.org](http://Akinori.org) / [MUSHA.org](http://MUSHA.org)  
/ ) ) ) ) / [FreeBSD.org](http://FreeBSD.org) / [Ruby-lang.org](http://Ruby-lang.org)  
Akinori MUSHA aka / (\_ / ( (\_\_( @ [iDaemons.org](http://iDaemons.org) / and.or.jp

“Different eyes see different things,  
Different hearts beat on different strings –  
But there are times for you and me when all such things agree”

---

<div class="post-metadata">

**Author:** ![Akinori\_MUSHA](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/b782af/32.png) [@Akinori\_MUSHA](https://www.ruby-forum.com/u/Akinori_MUSHA)\
**Post date:** [February 15, 2007, 8:22am UTC](https://www.ruby-forum.com/t/backporting-uri-to-ruby-1-8/85544/4 "2007-02-15T08:22:31Z")

</div>

At Thu, 15 Feb 2007 16:02:00 +0900,  
I wrote:

> At Thu, 15 Feb 2007 15:08:28 +0900,  
> Kazuhiro NISHIYAMA wrote:
> 
> > userinfo e$B$K4X$9$k%P%0=$@5$H$$$&$N$Oe(B[ruby-core:10290]e$B$Ne(B  
> > e$B6u$N%f!\<%6L\>$N\>l9g$K%Q%9%o!\<%I$rL5;k$9$k$h$&$K$9$k$He(B  
> > e$B$$$&;v$G$7$g$&$+e(B?
> 
> e$B!!$“!”%Q%C%A$N\<q;]$r4\*0c$$$7$F$$$^$7$?!#e(B

e$B!!8@$$Lu$9$k$H!"e(B ChangeLog  
e$B$@$1FI$s$G%P%0=$@5$H?.$8$F$7$^$$$^$7$?!#e(B

> e$B!!e(Bruby\_1\_8 e$B$G$O$$$C$?$sLa$7$^$9!#e(B
> 
> > [http://www.sic.med.tohoku.ac.jp/~mladmin/w3m-dev/200001.month/281.html](http://www.sic.med.tohoku.ac.jp/~mladmin/w3m-dev/200001.month/281.html)  
> > e$B$K$“$k$h$&$K6u$N%f!\<%6L\>$,;H$o$l$k$3$H$b$”$k$N$G!“e(B  
> > e$B:#$N5sF0$NJ}$,NI$$$H;W$&$N$G$9$,!”$I$&$G$7$g$&$+e(B?
> 
> e$B!!$o$6$o$6JRJ}$@$16u$K$7$F$$$k$N$@$+$i$=$N$^$^$G$$$$5$$,$7$^$9$M!#e(B

e$B!!e(BURI.parse() e$B$H$NBP\>N@-$r9M$($l$P$3$&$9$Y$-!#e(B

```
def userinfo
  if @user.nil?
    nil
  elsif @password.nil?
    @user
  else
    @user + ':' + @password
  end
end

```

–  
/  
/\_\_ \_\_ [Akinori.org](http://Akinori.org) / [MUSHA.org](http://MUSHA.org)  
/ ) ) ) ) / [FreeBSD.org](http://FreeBSD.org) / [Ruby-lang.org](http://Ruby-lang.org)  
Akinori MUSHA aka / (\_ / ( (\_\_( @ [iDaemons.org](http://iDaemons.org) / and.or.jp

“Different eyes see different things,  
Different hearts beat on different strings –  
But there are times for you and me when all such things agree”

---

<div class="post-metadata">

**Author:** ![Akinori\_MUSHA](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/b782af/32.png) [@Akinori\_MUSHA](https://www.ruby-forum.com/u/Akinori_MUSHA)\
**Post date:** [February 15, 2007, 8:24am UTC](https://www.ruby-forum.com/t/backporting-uri-to-ruby-1-8/85544/5 "2007-02-15T08:24:31Z")

</div>

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:30352] Re: backporting URI to ruby\_1\_8”  
on Thu, 15 Feb 2007 16:02:00 +0900, “Akinori MUSHA”  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

|\> userinfo e$B$K4X$9$k%P%0=$@5$H$$$&$N$Oe(B[ruby-core:10290]e$B$Ne(B  
|\> e$B6u$N%f!\<%6L\>$N\>l9g$K%Q%9%o!\<%I$rL5;k$9$k$h$&$K$9$k$He(B  
|\> e$B$$$&;v$G$7$g$&$+e(B?  
|  
|e$B!!$“!”%Q%C%A$N\<q;]$r4\*0c$$$7$F$$$^$7$?!#e(B  
|e$B!!e(Bruby\_1\_8 e$B$G$O$$$C$?$sLa$7$^$9!#e(B

e$B$“$N%Q%C%A$K$O!V%Q%9%o!\<%I$Ke(Bnile$B$r@\_Dj$9$k$HL5;k$9$k!W$H$$$&e(B  
e$BLdBj$KBP$9$k=$@5$,4^$^$l$F$$$^$9$N$G!”$=$A$i$O0UL#$,$"$k$H;We(B  
e$B$$$^$9!#e(B

---

<div class="post-metadata">

**Author:** ![Akinori\_MUSHA](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/b782af/32.png) [@Akinori\_MUSHA](https://www.ruby-forum.com/u/Akinori_MUSHA)\
**Post date:** [February 15, 2007, 8:35am UTC](https://www.ruby-forum.com/t/backporting-uri-to-ruby-1-8/85544/6 "2007-02-15T08:35:32Z")

</div>

At Thu, 15 Feb 2007 16:23:48 +0900,  
matz wrote:

> |e$B!!e(Bruby\_1\_8 e$B$G$O$$$C$?$sLa$7$^$9!#e(B
> 
> e$B$“$N%Q%C%A$K$O!V%Q%9%o!\<%I$Ke(Bnile$B$r@\_Dj$9$k$HL5;k$9$k!W$H$$$&e(B  
> e$BLdBj$KBP$9$k=$@5$,4^$^$l$F$$$^$9$N$G!”$=$A$i$O0UL#$,$"$k$H;We(B  
> e$B$$$^$9!#e(B

e$B!!$O$$!#e(Bset\_password() e$B$N=$@5$H!"e(B userinfo() e$B$Ne(B +  
e$B$G$3$1$kLdBj$Ne(B  
e$B=$@5$O;D$7$^$9!#e(B

–  
/  
/\_\_ \_\_ [Akinori.org](http://Akinori.org) / [MUSHA.org](http://MUSHA.org)  
/ ) ) ) ) / [FreeBSD.org](http://FreeBSD.org) / [Ruby-lang.org](http://Ruby-lang.org)  
Akinori MUSHA aka / (\_ / ( (\_\_( @ [iDaemons.org](http://iDaemons.org) / and.or.jp

“Different eyes see different things,  
Different hearts beat on different strings –  
But there are times for you and me when all such things agree”

---

<div class="post-metadata">

**Author:** ![Akinori\_MUSHA](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/b782af/32.png) [@Akinori\_MUSHA](https://www.ruby-forum.com/u/Akinori_MUSHA)\
**Post date:** [February 15, 2007, 12:32pm UTC](https://www.ruby-forum.com/t/backporting-uri-to-ruby-1-8/85544/7 "2007-02-15T12:32:53Z")

</div>

At Wed, 14 Feb 2007 22:06:05 +0900,  
I wrote:

> e$B!!$^$:!"e(B userinfo e$B$K4X$9$k%P%0=$@5$He(BFTPe$B%9%-!\<%`$Ne(B path e$B$K4X$9$ke(B  
> e$B=$@5$K0[O@$O$J$$$H;W$$$^$9!#e(B

e$B!!$H=q$$$F$7$^$$$^$7$?$,!"e(BFTPe$B%9%-!\<%`$Ne(B path  
e$B$N=$@5$O!"7k2LE\*$Ke(B  
e$BHs8\_49@-$r\>7$/$N$G5DO@$,I,MW$G$7$?!#e(B

e$B!!=$@5$N0M5r$Oe(B RFC 1738 e$B$G$9!#e(B"ftp://example.net/foo/bar"  
e$B$Ne(B  
path e$B$Oe(B “/foo/bar” e$B$G$J$/e(B “foo/bar” e$B$G$"$j!“e(B  
[example.net](http://example.net) e$B\>e$Ne(B  
“/foo/bar” e$B$Oe(B “ftp://example.net/%2Ffoo/bar” e$B$G$”$k$H!#e(B

e$B!!$?$@!"e(B uri.path = ‘/foo/bar’ e$B$7$F$b@dBP%Q%9$K$J$i$:!“e(B  
uri.path = ‘foo/bar’ e$B$,%(%i!\<$K$J$k5sF0$O$h$/$o$+$j$^$;$s!#e(B  
e$BFbIt$GJ];}$7$F$$$ke(B @path e$B$H%”%/%;%5e(B path  
e$B$NBP1~$,OD$s$G$\*$j!"e(B  
uri.path = uri.path e$B$GNc30H/@8$H$$$&$N$O$I$&$+$H;W$$$^$9!#e(B

e$B!!$3$N$“$?$j!”$^$@$d$j$+$1$J$N$G$7$g$&$+!#e(B

e$B!!$R$H$^$:e(B ruby\_1\_8, ruby\_1\_8\_6 e$B$G$OLa$7$^$9!#e(B

–  
/  
/\_\_ \_\_ [Akinori.org](http://Akinori.org) / [MUSHA.org](http://MUSHA.org)  
/ ) ) ) ) / [FreeBSD.org](http://FreeBSD.org) / [Ruby-lang.org](http://Ruby-lang.org)  
Akinori MUSHA aka / (\_ / ( (\_\_( @ [iDaemons.org](http://iDaemons.org) / and.or.jp

“Different eyes see different things,  
Different hearts beat on different strings –  
But there are times for you and me when all such things agree”
