[Feature #747] /\A/u ignores BOM


#1

Feature #747: /\A/u ignores BOM
http://redmine.ruby-lang.org/issues/show/747

e$B5/I<<Te(B: Shyouhei U.
e$B%9%F!<%?%9e(B: Open, e$BM%@hEYe(B: Normal
e$BC4Ev<Te(B: Yui NARUSE, e$B%+%F%4%je(B: M17N, Target version: 1.9.x

/\A/ue$B$,e(BBOMe$B$K%R%C%H$7$J$$$N$,4r$7$/$J$$$G$9!#IaDL!“e(BBOMe$B$O$”$k$H$9$l$PJ8;zNs$N@hF,$KIU$$$F$$$k$3$H$,B?$$$N$G!"e(B/\A/ue$B$,e(BBOMe$B$K%R%C%H$9$k$N$,<+A3$@$H;W$$$^$9!#e(B

e$B$"$k$$$Oe(B/\Z/e$B$He(B/\z/e$B$N$h$&$Ke(BBOMe$B$K%R%C%H$9$ke(B/\a/e$B$H$7$J$$e(B/\A/e$B$H$+$"$C$F$b$$$$$+$b$7$l$^$;$s$,!"$$$:$l$K$;$he(BBOMe$B$rE,@Z$K@hF,$H$_$J$7$F$/$l$k%a%?%-%c%i%/%?$r4uK>$7$^$9!#$G$J$$$HKh2se(B
/\A(\xEF\xBB\xBF)?/ue$B$H$+=q$+$J$$$H$$$1$J$/$J$C$FHs>o$KLLE]$G$9!#e(B

% ~/target/branches/ruby_1_9_1/bin/ruby -Ku -ve ‘p /\Afoo/u =~
“\xEF\xBB\xBFfoo”’
ruby 1.9.1 (2008-11-12 revision 20221) [x86_64-linux]
-e:1: warning: ambiguous first argument; put parentheses or even spaces
nil


#2

On Wed, 12 Nov 2008 17:49:47 +0900
In article removed_email_address@domain.invalid
[[ruby-dev:37075] [Feature #747] /\A/u ignores BOM]
Shyouhei U. removed_email_address@domain.invalid wrote:

/\A/ue$B$,e(BBOMe$B$K%R%C%H$7$J$$$N$,4r$7$/$J$$$G$9!#IaDL!“e(BBOMe$B$O$”$k$H$9$l$PJ8;zNs$N@hF,$KIU$$$F$$$k$3$H$,B?$$$N$G!"e(B/\A/ue$B$,e(BBOMe$B$K%R%C%H$9$k$N$,<+A3$@$H;W$$$^$9!#e(B

http://www.ietf.org/rfc/rfc3629.txt
RFC 3629 e$B$rFI$`$H!“FbIt=hM}$K$Oe(B U+FEFF
e$B$rFCJL07$$$7$J$$$3$H$r?d>)$7$F$$e(B
e$B$k$h$&$K;W$$$^$9$,!”$I$&$J$s$G$7$g$&!#e(B


#3

e$BKNIt$G$9!#e(B

Tietew e$B$5$s$O=q$-$^$7$?e(B:

RFC 3629 e$B$rFI$`$H!“FbIt=hM}$K$Oe(B U+FEFF e$B$rFCJL07$$$7$J$$$3$H$r?d>)$7$F$$e(B
e$B$k$h$&$K;W$$$^$9$,!”$I$&$J$s$G$7$g$&!#e(B

e$BF1$8e(BRFCe$B$K!"e(B

It is therefore RECOMMENDED to avoid stripping an initial U+FEFF
interpreted as a signature without a good reason, to ignore it instead
of stripping it when appropriate (such as for display) and to strip it
only when really necessary.

e$B$H$"$j$^$9!#@lLg2H$G$O$J$$$N$G30$7$F$k$+$b$7$l$^$;$s$,!"$3$Ne(B(such
as for
display)e$B$N$H$3$m$K@55,I=8=%^%C%A$b4^$^$l$k$s$8$c$J$$$G$7$g$&$+!#e(B


#4

e$BLZB<$G$9!#e(B

Shyouhei U. e$B$5$s$O=q$-$^$7$?e(B:

% ~/target/branches/ruby_1_9_1/bin/ruby -Ku -ve ‘p /\Afoo/u =~ “\xEF\xBB\xBFfoo”’
ruby 1.9.1 (2008-11-12 revision 20221) [x86_64-linux]
-e:1: warning: ambiguous first argument; put parentheses or even spaces
nil

BOMe$B$r$I$&$K$+$7$?$$$H$$$&$N$OF146$G$9$,!“e(B\Ae$B$O!V%”%s%+!<!W$H$J$k%a%?J8;ze(B
e$B$J$N$G!“e(B
e$B%”%s%+!<$G$O$J$/$J$ke(B(e$B!VI}$r$b$D!We(B)e$B$h$&$JF0:n$ONI$/$J$$$h$&$J5$$,$7$^$9!#e(B
e$BJ8;zNs@hF,$K$"$ke(B\xef\xbb\bfe$B$ND>8e!"$H$$$&$N$b9M$($i$l$J$/$b$J$$$G$9$,!"e(B
e$B$3$l$O$3$l$G$&$l$7$/$J$$$G$9$M$(!#e(B


#5

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

In message “[ruby-dev:37077] Re: [Feature #747] /\A/u ignores BOM”
on Nov.12,2008 18:40:30, removed_email_address@domain.invalid wrote:

/\A/ue$B$,e(BBOMe$B$K%R%C%H$7$J$$$N$,4r$7$/$J$$$G$9!#IaDL!“e(BBOMe$B$O$”$k$H$9$l$PJ8;zNs$N@hF,$KIU$$$F$$$k$3$H$,B?$$$N$G!"e(B/\A/ue$B$,e(BBOMe$B$K%R%C%H$9$k$N$,<+A3$@$H;W$$$^$9!#e(B

http://www.ietf.org/rfc/rfc3629.txt
RFC 3629 e$B$rFI$`$H!“FbIt=hM}$K$Oe(B U+FEFF e$B$rFCJL07$$$7$J$$$3$H$r?d>)$7$F$$e(B
e$B$k$h$&$K;W$$$^$9$,!”$I$&$J$s$G$7$g$&!#e(B

e$B$H$$$&$o$1$G!"0JA0$N5DO@$G7kO@$,=P$:$K8+Aw$j$K$J$j$^$7$?$,!"e(B
e$B$d$O$je(BBOMe$B$rM}2r$9$ke(Bopene$B$,I,MW$J$s$8$c$J$$$G$7$g$&$+!#e(B

e$B$J$0JA0$N5DO@$N:]$N7kO@<+BN$Oe(B[ruby-dev:32981]e$B$K$^$H$a$F$"$je(B
e$B$^$9$,!"$"$N;~$O=q$-9~$;~$Ke(BBOMe$B$r$I$&07$($P$$$$$N$+H=CG$G$-$Je(B
e$B$+$C$?$N$,8+Aw$j$N<g860x$G$7$?!#e(B
e$B:#2s$O!"=q$-9~$
$O8=>u$I$
$j$H$7$F!"FI$9~$;~$N$e(BBOMe$B$r<h$j07e(B
e$B$&$H$$$&0F$rDs0F$7$F$
$^$9!#e(B

e$B$J$*e(B1.9.1e$B$KF~$l$k$3$H$OA[Dj$7$F$$$^$;$s!#e(B

e$BBP>]$H$J$k$N$Oe(B"r"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&Lr3de(B
e$B$b$”$j$^$9$7!"@55,I=8=$G$OB?$/$N>l9g%U%!%$%k$N@hF,$G$O$J$/!"C1$J$k2?$+$Ne(B
e$BJ8;zNs$r%^%C%A$7$^$9$N$G!"e(BBOM
e$B$rFCJL07$$:~$k$N$O9%$^$7$/$J$$$H;W$$$^$9!#e(B

e$B$I$&$7$F$b:#$h$je(B Ruby e$B$Ne(B BOM
e$B$X$NBP1~$r6/2=$7$?$$$H$J$i!"J8;zNsJQ49e(B
(e$B%U%!%$%kF~=PNO8BDje(B) e$B$Ge(B :bom => :remove (e$BF~NO$N>l9ge(B)
e$B$H$+e(B :bom => :add
(e$B=PNO$N>l9ge(B) e$B$H$+$NJ}8~$G9M$($?J}$,$$$$$+$H;W$$$^$9!#e(B

e$B59$7$/$*4j$$$7$^$9!#e(B Martin.

#-#-# Martin J. Du"rst, Assoc. Professor, Aoyama Gakuin University
#-#-# http://www.sw.it.aoyama.ac.jp mailto:removed_email_address@domain.invalid


#7

e$B>.@>90>-$G$9!#e(B

[ruby-dev:32981]e$B$NJ}$bFI$s$G$_$F!":#$N>u67$,$h$/$o$+$i$J$+$C$?$N$G<ALd$5e(B
e$B$;$F$/$@$5$$!#8=;~E@$Ge(BRuby-1.9e$B7O$Oe(B2BYTE
Unicodee$B$NJ8;zNs$rFI$_9~$s$@>le(B
e$B9g!"$I$N$h$&$JFbItI=8=$H$J$k$N$G$7$g$&$+!#e(B

e$BFbItI=8=$Oe(BUTF-16e$B$K$J$k!#e(B(e$BFI$9~$;~$N%(%s%G%#%"%s;XDj$,E,@Z$K9T$o$l$Fe(B
e$B$$$k2>Dj$N2<$G!"e(BUTF-16LEe$B$be(BUTF16-BEe$B$bFbItI=8=$OF1$8%P%$%J%jNs$K$J$k$H$$$&e(B
e$B$3$H$G$9e(B)

Ruby-1.8e$B7O$HF1$8$/!“J8;zNs$O%P%$%HNs$G$”$j!"%P%$%HC10L$GFI$_9~$^$l$?e(B
e$B$b$N$,FbItI=8=$K0lCW$9$k!#e(B

  1. e$B$=$l0J30e(B

3e$B$O!"A4$/A[A|$,$D$-$^$;$s$,!“e(B1e$B$NN)>l$r$H$k$N$G$”$l$Pe(BBOMe$B$OFbItI=8=$H$7$Fe(B
e$BITMW$G$9$7!“5U$Ke(B2.e$B$NN)>l$G$”$l$P!"I,MW$G$9$N$Ge(BBOMe$B$,FbItI=8=$KF~$C$F$$$Je(B
e$B$$$N$OIT<+A3$K1G$j$^$9!#e(B

e$B$=$N>e$Ge(B2.e$B$N>l9g$K@55,I=8=$r$9$k0UL#$rLd$&$?>l9g!“8=:_Ds5/$5$l$F$$$kLdBje(B
e$B$,5/$3$k$N$G$O$J$$$G$7$g$&$+e(B?
e$B;d$O!“e(BBOMe$B$H$O%P%$%HC10L$N%a%G%#%”$Ke(B2e$B%P%$%H$NJ8;z$r=q$-9~$`$H$3$m$N%(%se(B
e$B%3!<%G%#%s%0$H!“e(BPCe$B>e$Ge(B16e$B%S%C%HC10L$GJ8;z$r07$&$?$a$N2M$166$K$9$.$J$$$H;We(B
e$B$$$^$9!#e(B
e$B8D?ME*$K$O!“e(B2e$B$N%9%?%s%9$G$b!”@55,I=8=$J$IJ8;zNs$H$7$F=hM}$9$k>l9g$K$O!“e(B
e$B0l2se(BUTF-16e$B$J$I$KJQ49$7$F$+$i07$&$h$&$K$9$k$N$,$h$$$h$&$K;W$($^$9!#e(B
e$B$”$^$j9M$($K$/$$$G$9$1$I!”$=$N$^$^07$&I,MW$,$”$k$h$&$J%K!<%:$K$D$$$F$O!"e(B
e$B%f!<%6!<$,8D!9$KBP1~$9$kLdBj$N$h$&$K46$8$^$9!#e(B


#8

At 19:31 08/11/12, Urabe S. wrote:

e$B$N@hF,$KIU$$$F$$$k$3$H$,B?$$$N$G!"e(B/\A/ue$B$,e(BBOMe$B$K%R%C%H$9$k$N$,<+A3$@$H;W$$$^$9!#e(B
of stripping it when appropriate (such as for display) and to strip it
only when really necessary.

e$B$3$l$O%U%!%$%kA4BN$N>l9g$K$O!"Nc$($PEE;R=pL>$J$I$N4X78$G$h$/J,$+$j$^$9$,!"e(B
e$B%9%/%j%W%H$J$I$G%U%!%$%k$r$3$^@Z$l$7$F=hM}$9$k$H$-$K$O$J$+$J$+Fq$7$$$G$9!#e(B
e$B4pK\E*$K$OFI$9~$$N;~$Ke(B BOM
e$B$r=|5n$7!"I,MW$G$7$?$i$=$NM-L5$r5-21$7!"e(B
e$B=PNO$KI,MW$K1~$8$FL$$@IU$1$k$N$,@5$7$$$H;W$$$^$9!#$=$&$7$J$$$H=hM}$K$h$C$Fe(B
BOM
e$B$,@hF,$+$i%U%!%$%k$NFbIt$K0\F0$9$k$J$I0UL#$N$J$$7k2L$K$J$C$F$7$^$$$^$9!#e(B

e$B6KC<$K8@$&$He(B /\A\uFEFF/u
e$B$O$I$&$$$&>l9g$K%^%C%A$9$Y$-$G$7$g$&$+!#e(B

e$B59$7$/$*4j$$$7$^$9!#e(B Martin.

e$B$H$"$j$^$9!#@lLg2H$G$O$J$$$N$G30$7$F$k$+$b$7$l$^$;$s$,!"$3$Ne(B(such as for
display)e$B$N$H$3$m$K@55,I=8=%^%C%A$b4^$^$l$k$s$8$c$J$$$G$7$g$&$+!#e(B

#-#-# Martin J. Du"rst, Assoc. Professor, Aoyama Gakuin University
#-#-# http://www.sw.it.aoyama.ac.jp mailto:removed_email_address@domain.invalid


#9

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

In message “[ruby-dev:37086] Re: [Feature #747] /\A/u ignores BOM”
on Nov.13,2008 17:32:25, removed_email_address@domain.invalid wrote:

[ruby-dev:32981]e$B$NJ}$bFI$s$G$_$F!":#$N>u67$,$h$/$o$+$i$J$+$C$?$N$G<ALd$5e(B
e$B$;$F$/$@$5$$!#8=;~E@$Ge(BRuby-1.9e$B7O$Oe(B2BYTE Unicodee$B$NJ8;zNs$rFI$_9~$s$@>le(B
e$B9g!"$I$N$h$&$JFbItI=8=$H$J$k$N$G$7$g$&$+!#e(B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^$7$?!#e(B (by Yukihiro M.)

e$B%9%F!<%?%9e(B Opene$B$+$ie(BRejectede$B$KJQ99e(B

BOMe$BBP1~$,ITMW$H$O8@$$$^$;$s$,!"@55,I=8=$GBP1~$9$k$N$O$h$/$J$$$H;W$$$^$9!#e(B

http://redmine.ruby-lang.org/issues/show/747


#12

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

In message “[ruby-dev:37088] Re: [Feature #747] /\A/u ignores BOM”
on Nov.13,2008 18:13:39, removed_email_address@domain.invalid wrote:

e$BBgBNJ,$+$C$F$-$?$h$&$J5$$,$7$^$9!#IaDL$Ke(Bopene$B$GFI$_9~$s$@>l9g$Oe(B2.(=A)e$B$J$Ne(B
e$B$G$9$M!#$Ge(BStringe$B%*%V%8%’%/%H$KJQ49$7$?>l9g$O!"%(%s%3!<%G%#%s%0$r;}$De(B(B)
e$B$H!#e(B

e$B$"!<!“IaDL!”$H$$$&$+!"%(%s%3!<%G%#%s%0$r;XDj$;$:$K%U%!%$%k$re(B
e$B%!<%W%s$7$?>l9g$Oe(Blocalee$B$N%(%s%3!<%G%#%s%0$r;XDj$7$?$H$_$J$5e(B
e$B$l$^$9!#e(B
e$B$N$G!“e(B2.(=A)e$B$K$O$J$i$J$$$G!”$
$=$i$/4V0c$C$?%(%s%3!<%G%#%s%0e(B
e$B$,IUM?$5$l$?J8;zNs$,@8@.$5$l$F$7$^$&$H;W$o$l$^$9!#e(B

e$B$J$N$G!"@5>o7O$H$7$F$O!“L@<(E*$K%(%s%3!<%G%#%s%0$H$7$F%P%$%Je(B
e$B%jNse(B(ASCII-8BIT)e$B$,;XDj$5$l$k$+!“L@<(E*$Ke(BUTF-16LEe$B$^$?$Oe(BUTF-16BE
e$B$,;XDj$5$l$k$+!”$$$:$l$+$7$+$”$j$($^$;$s!#e(B

e$B$d$O$j!"@55,I=8=$r;H$&$N$G$"$l$P!“e(BBe$B$N>uBV$Ge(BBOMe$B$rIU$1$J$$J}$,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=i$Ke(BBOMe$B$,<+F0E$KFI$_<Ne(B
e$B$F$i$l$ke(Bopene$B$rMQ0U$9$k$N$,L5Fq$@$m$&$H;W$$$^$9!#e(B

e$B$=$l$G$O!#e(B


#13

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

In message “Re: [ruby-dev:37223] [Feature #747] /\A/u ignores BOM”
on Fri, 28 Nov 2008 19:18:13 +0900, Shyouhei U.
removed_email_address@domain.invalid writes:

|e$B$J$*!"$Y$D$K@55,I=8=$GBP1~$5$l$F$$$J$/$F$b!";d$,D>LL$7$F$$$kLdBje(B(e$B$D$^$je(B/\A#{foo}/e$B$Ke(B
|File#reade$B$7$?J8;zNs$rEO$7$F$b0U?^$7$?%^%C%A$K$J$i$J$$e(B)e$B$,2r7h$5$l$l$P9=$$$^$;$s!#e(B
|
|e$B$D$^$j@55,I=8=$GBP1~$7$J$$$J$ie(Bopene$BB&$GBP1~$7$FM_$7$$$o$1$G$9$,!"$=$l$O?7$?$K%A%1%C%He(B
|e$B5/$3$7$?J}$,$$$$$s$G$9$+$Me(B?

e$B$O$$!#$*4j$$$7$^$9!#e(B


#14

e$B%A%1%C%He(B #747 e$B$,99?7$5$l$^$7$?!#e(B (by Shyouhei U.)

e$B$J$*!"$Y$D$K@55,I=8=$GBP1~$5$l$F$$$J$/$F$b!";d$,D>LL$7$F$$$kLdBje(B(e$B$D$^$je(B/\A#{foo}/e$B$Ke(B
File#reade$B$7$?J8;zNs$rEO$7$F$b0U?^$7$?%^%C%A$K$J$i$J$$e(B)e$B$,2r7h$5$l$l$P9=$$$^$;$s!#e(B

e$B$D$^$j@55,I=8=$GBP1~$7$J$$$J$ie(Bopene$BB&$GBP1~$7$FM_$7$$$o$1$G$9$,!"$=$l$O?7$?$K%A%1%C%He(B
e$B5/$3$7$?J}$,$$$$$s$G$9$+$Me(B?

http://redmine.ruby-lang.org/issues/show/747