Project

General

Profile

Actions

Feature #3036

closed

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

Added by naruse (Yui NARUSE) almost 14 years ago. Updated almost 13 years ago.

Status:
Closed
Target version:

Description

=begin
[ruby-dev:40540] の String#encode(to, from, opt) の opt[:replace] に Hash の話を、
別にチケットとして起こしておきます

String#encode(to, from, opt) の opt[:replace] に Hash を与えられるようにして、
そこに、変換元 encoding の文字 => 変換先の文字、という未定義文字の fallback 変換表を与えられるようにする、
というものを今考えています。
これだと例えば、
fallbacks = {
?¥uE6AD => "[ふくろ]",
?¥u{1F4BA} => "[いす]"
}
"¥u{3042 E6AD 1F4BA}".encode("UTF8-KDDI", replace: fallbacks) #=> "あ[ふくろ][いす]"
=end

Actions #1

Updated by naruse (Yui NARUSE) almost 14 years ago

  • Target version set to 1.9.2

=begin
反対がないので、1.9.2 の feature として認められたとみなします。
なお、実装を諦めた場合や、4月中にできなかった場合は 1.9.2 には入りません。
=end

Actions #2

Updated by znz (Kazuhiro NISHIYAMA) almost 14 years ago

  • Category set to core

=begin

=end

Actions #3

Updated by naruse (Yui NARUSE) almost 14 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

=begin
This issue was solved with changeset r27326.
Yui, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0