4件ヒット
[1-4件を表示]
(0.072秒)
別のキーワード
ライブラリ
- ビルトイン (4)
キーワード
-
append
_ as _ bytes (1) -
unicode
_ normalize (1) -
unicode
_ normalize! (1) -
unicode
_ normalized? (1)
検索結果
先頭4件
-
String
# unicode _ normalize(form = :nfc) -> String (43.0) -
self を NFC、NFD、NFKC、NFKD のいずれかの正規化形式で Unicode 正規化し た文字列を返します。
...# => 'à' ("\u00E0" と同じ)
"\u00E0".unicode_normalize(:nfd) # => 'à' ("a\u0300" と同じ)
"\xE0".force_encoding('ISO-8859-1').unicode_normalize(:nfd)
# => Encoding::CompatibilityError raised
//}
@see String#unicode_normalize!, String#unicode_normalized?... -
String
# unicode _ normalized?(form = :nfc) -> bool (43.0) -
self が引数 form で指定された正規化形式で Unicode 正規化された文字列か どうかを返します。
...=> true
"\u00E0".unicode_normalized? # => true
"\u00E0".unicode_normalized?(:nfd) # => false
"\xE0".force_encoding('ISO-8859-1').unicode_normalized?
# => Encoding::CompatibilityError raised
//}
@see String#unicode_normalize, String#unicode_normalize!... -
String
# append _ as _ bytes(*objects) -> self (25.0) -
引数で与えたオブジェクトをバイト列として、self に破壊的に連結します。
...は連結できない
s << "い" # => "incompatible character encodings: BINARY (ASCII-8BIT) and UTF-8 (Encoding::CompatibilityError)
//}
//emlist[引数で整数を渡す例][ruby]{
t = ""
t.append_as_bytes(0x61) # => "a"
t.append_as_bytes(0x3062) # => "ab"
//}
@see String#<<, String#concat... -
String
# unicode _ normalize!(form = :nfc) -> self (25.0) -
self を NFC、NFD、NFKC、NFKD のいずれかの正規化形式で Unicode 正規化し た文字列に置き換えます。
...に発生します。
//emlist[例][ruby]{
text = "a\u0300"
text.unicode_normalize!(:nfc)
text == "\u00E0" # => true
text.unicode_normalize!(:nfd)
text == "a\u0300" # => true
//}
@see String#unicode_normalize, String#unicode_normalized?...