[Feature #3036] String#encode(to, from, opt) の opt[:replace] に Hash

Feature #3036: String#encode(to, from, opt) e$B$Ne(B opt[:replace]
e$B$Ke(B Hash
http://redmine.ruby-lang.org/issues/show/3036

e$B5/I<<Te(B: Yui NARUSE
e$B%9%F!<%?%9e(B: Assigned, e$BM%@hEYe(B: Normal
e$BC4Ev<Te(B: Yui NARUSE

[ruby-dev:40540] e$B$Ne(B String#encode(to, from, opt) e$B$Ne(B
opt[:replace] e$B$Ke(B Hash e$B$NOC$r!"e(B
e$BJL$K%A%1%C%H$H$7$F5/$3$7$F$*$-$^$9e(B

String#encode(to, from, opt) e$B$Ne(B opt[:replace] e$B$Ke(B Hash
e$B$rM?$($i$l$k$h$&$K$7$F!"e(B
e$B$=$3$K!JQ4985e(B encoding e$B$NJ8;ze(B =>
[email protected]$NJ8;z!$H$$$&L$Dj5AJ8;z$Ne(B fallback
e$BJQ49I=$rM?$($i$l$k$h$&$K$9$k!"e(B
e$B$H$$$&$b$N$r:#9M$($F$$$^$9!#e(B
[email protected]$HNc$($P!"e(B
fallbacks = {
?e$B!oe(BuE6AD => [e$B$U$/$me(B],
?e$B!oe(Bu{1F4BA} => [e$B$$$9e(B]
}
e$B!oe(Bu{3042 E6AD 1F4BA}.encode(UTF8-KDDI, replace: fallbacks) #=>
"e$B$e(B[e$B$U$/$me(B][e$B$$$9e(B]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs