e$B@.@%$G$9!#e(B
Yukihiro M. wrote:
|> Encoding.unknown?
|>
|> e$B$N$h$&$JBeMQIJ%U%i%0$rDs6!$9$k$3$H$G$9!#e(B
|
|e$B%l%W%j%+%(%s%3!<%G%#%s%0$Oe(Bbased_encodinge$B$,e(Bnon-nil e$B$rJV$7$^$9$+$i!"e(B
|e$B0l1~$=$l$G6hJL$O$G$-$^$9!#e(B
e$B$=!<$+$"!"$=$l$G==J,$+$J$"!#e(B
[ruby-dev:32456] e$B$r>x$7JV$9$H!"e(B
- Ruby e$B=hM}7O$H$7$FBP1~$7$F$$$k%(%s%3!<%G%#%s%0$NJLL>$O!"e(B
e$B!!BP1~$7$F$$$k%(%s%3!<%G%#%s%0$N%l%W%j%+e(B (CP932 e$B$Oe(B Shift_JIS
e$B$N%l%W%j%+e(B)
- Ruby e$B=hM}7O$H$7$FBP1~$7$F$$$J$$%(%s%3!<%G%#%s%0$O!"e(B
e$B!!e(BASCII-8BIT e$B$N%l%W%j%+e(B (UTF-16 e$BEye(B)
e$B$H$$$&J}?K$G$$$$$N$G$7$g$&$+!#e(B
e$B$^$?!“e(Bbased_encoding e$B$,e(B ASCII-8BIT e$B$J$i$Pe(B Ruby M17N
e$B$,BP1~$7$F$$$J$$%(%se(B
e$B%3!<%G%#%s%0$G$”$k$H9M$($F$$$$$N$G$7$g$&$+!#e(B
newstr = str.encode(“some-encoding”)
if newstr.encoding.based_encoding == Encoding::ASCII_8BIT
raise "ruby doesn’t support " + newstr.encoding.to_s
end
e$BL>A0$Ke(B
“iso-2022-jp (unknown)”
e$B$N$h$&$JJ8;zNs$r4^$`$N$bNI$$$+$b$7$l$^$;$s!#$?$@$7!“e(B
e$B!Ve(Bunknowne$B!W$h$j$b$b$C$H$U$5$o$7$$C18l$,$”$j$=$&$G$9$1$I!#e(B
|e$BL>A0$+$ie(BEncodinge$B$X$NBP1~$,LLE]$J$3$H$K$J$j$=$&$J5$$,$7$^$9!#e(B
Encodinge$BL>$He(Bto_se$BI=8=$rJ,N%$9$k$H$+!#e(B
to_s e$B$KM>7W$JJ8;zNs$,F~$C$F$$$k$H!"e(BXML
e$B$N%(%s%3!<%G%#%s%0L>Ey$Ge(B to_s e$B$Ke(B
e$B=PNO$7$?$j!"e(BIconv e$BEy$KEO$C$?$H$-$KLq2p$=$&$G$9!#e(B
At Wed, 12 Dec 2007 02:49:09 +0900,
NARUSE, Yui wrote:
[ruby-dev:32456] e$B$r>x$7JV$9$H!"e(B
- Ruby e$B=hM}7O$H$7$FBP1~$7$F$$$k%(%s%3!<%G%#%s%0$NJLL>$O!"e(B
e$B!!BP1~$7$F$$$k%(%s%3!<%G%#%s%0$N%l%W%j%+e(B (CP932 e$B$Oe(B Shift_JIS e$B$N%l%W%j%+e(B)
CP932 e$B$He(B Shift_JIS e$B$OJLJ*$J$s$G$9$,!"F10l07$$$K$7$Fe(B
e$B:$$k?M$O$$$J$$$N$G$7$g$&$+$Me(B?
e$B@.@%$G$9!#e(B
SATOH Fumiyasu wrote:
At Wed, 12 Dec 2007 02:49:09 +0900,
NARUSE, Yui wrote:
[ruby-dev:32456] e$B$r>x$7JV$9$H!"e(B
- Ruby e$B=hM}7O$H$7$FBP1~$7$F$$$k%(%s%3!<%G%#%s%0$NJLL>$O!"e(B
e$B!!BP1~$7$F$$$k%(%s%3!<%G%#%s%0$N%l%W%j%+e(B (CP932 e$B$Oe(B Shift_JIS e$B$N%l%W%j%+e(B)
CP932 e$B$He(B Shift_JIS e$B$OJLJ*$J$s$G$9$,!"F10l07$$$K$7$Fe(B
e$B:$$k?M$O$$$J$$$N$G$7$g$&$+$Me(B?
CP932 e$B$be(B Shift_JIS e$B$b!“J8;z$,e(B
/[\x00-\x7F\xA0-\xDF]|[\x81-\x9F\xE0-\xFC][\x40-\x7E\x80-\xFC]/
e$B$G$”$k$N$OF1$8$J$N$G!"e(BRuby e$B=hM}7O$ON><T$re(B Shift_JIS
e$B$H$7$FG’<1$H$7$F$$$le(B
e$B$PB-$j$^$9!#$h$C$F!"e(BCP932 e$B$Oe(B Shift_JIS
e$B$N%l%W%j%+$GB-$j$^$9!#e(B
e$B0lJ}!"30It$KJ8;zNs$r=PNO$9$k:]$K$O!“4^$^$l$kJ8;z=89g$de(B Unicode
e$B$H$N%^%Ce(B
e$B%T%s%0$re(B Shift_JIS e$B$de(B SJIS-open
e$BEy$H6hJL$9$kI,MW$,$”$j$^$9!#$3$l$b!“e(B
CP932 e$B$re(B Shift_JIS
e$B$N%l%W%j%+$H$7$F:n$C$F$*$1$P!“e(BEncoding::CP932 e$B$,B8:_e(B
e$B$9$k$N$G!”$3$l$re(B to_s e$B$7$F$d$l$Pe(B “CP932”
e$B$,JV$C$F$/$k$O$:$J$N$G!”$3$l$Ge(B
e$BB-$j$^$9!#e(B
e$B%l%W%j%+$G$J$/e(B alias e$B$K$7$F$7$^$&$H8e<T$G$3$1$^$9!#e(B
At 02:55 07/12/12, SATOH Fumiyasu wrote:
At Wed, 12 Dec 2007 02:49:09 +0900,
NARUSE, Yui wrote:
[ruby-dev:32456] e$B$r>x$7JV$9$H!"e(B
- Ruby e$B=hM}7O$H$7$FBP1~$7$F$$$k%(%s%3!<%G%#%s%0$NJLL>$O!"e(B
e$B!!BP1~$7$F$$$k%(%s%3!<%G%#%s%0$N%l%W%j%+e(B (CP932 e$B$Oe(B Shift_JIS e$B$N%l%W%j%+e(B)
CP932 e$B$He(B Shift_JIS e$B$OJLJ*$J$s$G$9$,!"F10l07$$$K$7$Fe(B
e$B:$$k?M$O$$$J$$$N$G$7$g$&$+$Me(B?
iconv e$B$G$Oe(B CP932 e$B$Ne(B1e$B%P%$%HJ8;z$O40A4$Ke(B ASCII
e$B$H$7$F07$o$l!“e(B
Shift_JIS e$B$N>l9g$Oe(B 0x5c e$B$,e(B U+00A5
e$B$K%^%C%T%s%0$5$l$k$J$I$Ne(B
e$B:9$b$”$j$^$9$,!“e(BRuby e$B$N>l9g$Oe(B Shift_JIS e$B$b40A4$Ke(B ASCII
e$B$Ge(B
e$B9M$($F$$$^$9$,!”$$$+$,$G$7$g$&$+!#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:[email protected]
e$B@.@%$G$9!#e(B
Martin D. wrote:
Shift_JIS e$B$N>l9g$Oe(B 0x5c e$B$,e(B U+00A5 e$B$K%^%C%T%s%0$5$l$k$J$I$Ne(B
e$B:9$b$"$j$^$9$,!“e(BRuby e$B$N>l9g$Oe(B Shift_JIS e$B$b40A4$Ke(B ASCII e$B$Ge(B
e$B9M$($F$$$^$9$,!”$$$+$,$G$7$g$&$+!#e(B
e$B$($’!"$=$l$,$$$$$H;W$$$^$9!#e(BPerl/Encode
e$B%F!<%V%k$b$=$&$J$C$F$$$^$7$?!#e(B
e$B$J$s$K$;$h!"FH<+$N%F!<%V%k$r?7$?$K:n$C$F$7$^$&$3$H$5$(Hr$1$l$P$$$$$+$J$!e(B
e$B$H$b;W$$$^$9!#e(B
e$B@.@%$G$9!#e(B
paptimusx scirocco wrote:
e$B$3$l$r07$&$?$a$K$Oe(Bcp932e$B$H$9$kI,MW$,$"$j$^$7$?!#$D$^$je(BShift_JISe$B$He(Bcp932e$B$Oe(B
e$BJL$N5sF0$r$7$^$9!#<+J,$G$O3NG’$7$F$$$^$;$s$,!"5U$K$O$7$49b$,e(Bcp932e$B$G$Oe(B
e$B07$($J$$$H$-$$$F$$$^$9!#e(B
e$B$H$$$&$o$1$Ge(BPerle$B$G$Oe(Biconve$B$r$D$+$C$F$$$k$H;W$&e(Bencodinge$B$@$1$G$OOC$,:Q$^$:!“e(B
e$Be$O0MA3$H$7$F4A;z%3!<%IJQ49$N$?$a$Ke(BJcodee$B$r;H$&I,MW$,$”$j$^$9!#e(B
e$B$H!"$3$&$$$&OC$G$O$J$+$C$?$i$9$$$^$;$s!#e(B
Shift_JIS
e$B$K$O4]IU$-J8;z$dGH%@%C%7%eEy$O4^$^$l$F$$$^$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