るりまサーチ (Ruby 3.1)

最速Rubyリファレンスマニュアル検索!
203件ヒット [201-203件を表示] (0.169秒)

別のキーワード

  1. openssl t61string
  2. asn1 t61string
  3. matrix t
  4. t61string new
  5. fiddle type_size_t

ライブラリ

キーワード

検索結果

<< < 1 2 3 >>

String#unicode_normalize!(form = :nfc) -> self (9007.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?...

String#unicode_normalized?(form = :nfc) -> bool (9007.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#valid_encoding? -> bool (9007.0)

文字列の内容が、現在のエンコーディングに照らしあわせて妥当であれば true を返します。そうでない場合は false を返します。

文字列の内容が、現在のエンコーディングに照らしあわせて妥当であれば
true を返します。そうでない場合は false を返します。

//emlist[例][ruby]{
"\xc2\xa1".force_encoding("UTF-8").valid_encoding? #=> true
"\xc2".force_encoding("UTF-8").valid_encoding? #=> false
"\x80".force_encoding("UTF-8").valid_encoding? #=> false
//}
<< < 1 2 3 >>