るりまサーチ

最速Rubyリファレンスマニュアル検索!
63件ヒット [1-63件を表示] (0.175秒)
トップページ > クエリ:i[x] > クエリ:l[x] > クエリ:CompatibilityError[x]

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. ipaddr to_i
  5. bigdecimal to_i

ライブラリ

クラス

検索結果

Encoding::CompatibilityError (30006.0)

2つのエンコーディング間に互換性がない場合に発生する例外。

...い場合に発生する例外。

エンコーディングの異なる文字列を連結しようとした場合などに発生します。

//emlist[例][ruby]{
"あ".encode("EUC-JP") + "あ".encode("UTF-8")
#=> Encoding::CompatibilityError: incompatible character encodings: EUC-JP and UTF-8
//}...

String#unicode_normalize(form = :nfc) -> String (12212.0)

self を NFC、NFD、NFKC、NFKD のいずれかの正規化形式で Unicode 正規化し た文字列を返します。

...lf を NFC、NFD、NFKC、NFKD のいずれかの正規化形式で Unicode 正規化し
た文字列を返します。

@param form 正規化形式を :nfc、:nfd、:nfkc、:nfkd のいずれかで指定しま
す。省略した場合は :nfc になります。

@raise Encoding::Compati...
...bilityError self が Unicode 文字列ではない場合
に発生します。

このメソッドでの "Unicode 文字列" とは、UTF-8、UTF-16BE/LE、
UTF-32BE/LE だけではなく GB18030、UCS_2BE、and UCS_4BE を含みます。

また、self が UTF-8...
...nicode_normalize(:nfc) # => 'à' ("\u00E0" と同じ)
"\u00E0".unicode_normalize(:nfd) # => 'à' ("a\u0300" と同じ)
"\xE0".force_encoding('ISO-8859-1').unicode_normalize(:nfd)
# => Encoding::CompatibilityError raised
//}

@see String#unicode_normalize!, Strin...

String#unicode_normalized?(form = :nfc) -> bool (12212.0)

self が引数 form で指定された正規化形式で Unicode 正規化された文字列か どうかを返します。

...self が引数 form で指定された正規化形式で Unicode 正規化された文字列か
どうかを返します。

@param form 正規化形式を :nfc、:nfd、:nfkc、:nfkd のいずれかで指定しま
す。省略した場合は :nfc になります。

@raise Encoding::Co...
...mpatibilityError self が Unicode 文字列ではない場合
に発生します。

//emlist[例][ruby]{
"a\u0300".unicode_normalized? # => false
"a\u0300".unicode_normalized?(:nfd) # => 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#unicode_normalize!(form = :nfc) -> self (12206.0)

self を NFC、NFD、NFKC、NFKD のいずれかの正規化形式で Unicode 正規化し た文字列に置き換えます。

...self を NFC、NFD、NFKC、NFKD のいずれかの正規化形式で Unicode 正規化し
た文字列に置き換えます。

(gsub!などと異なり)変換が行なわれなくても self を返します。

@param form 正規化形式を :nfc、:nfd、:nfkc、:nfkd のいずれかで指定し...
...ります。

@raise Encoding::CompatibilityError self が 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?...

Regexp#fixed_encoding? -> bool (6212.0)

正規表現が任意の ASCII 互換エンコーディングとマッチ可能な時に false を返します。

...任意の ASCII 互換エンコーディングとマッチ可能な時に false を返します。

//emlist[例][ruby]{
# -*- coding:utf-8 -*-

r = /a/
r.fixed_encoding? # => false
r.encoding # => #<Encoding:US-ASCII>
r =~ "\u{6666}...
...force_encoding("euc-jp") # => 2
r =~ "abc".force_encoding("euc-jp") # => 0

r = /a/u
r.fixed_encoding? # => true
r.encoding # => #<Encoding:UTF-8>
r =~ "\u{6666} a" # => 2
begin
r =~ "...
...\xa1\xa2".force_encoding("euc-jp")
rescue => e
e.class # => Encoding::CompatibilityError
end
r =~ "abc".force_encoding("euc-jp") # => 0

r = /\u{6666}/
r.fixed_encoding? # => true
r.encoding...

絞り込み条件を変える

正規表現 (120.0)

正規表現 * metachar * expansion * char * anychar * string * str * quantifier * capture * grouping * subexp * selector * anchor * cond * option * encoding * comment * free_format_mode * absenceop * list * specialvar * references

...achar
* expansion
* char
* anychar
* string
* str
* quantifier
* capture
* grouping
* subexp
* selector
* anchor
* cond
* option
* encoding
* comment
* free_format_mode
* absenceop
* list
* specialvar
* references


正規表現(regular expression)は文字列...
...るかどうかを判定し、
また含んでいるならばそれが文字列中のどの場所であるかを知ることができます。

//emlist[][ruby]{
/pat/
%r{pat}
//}

などの正規表現リテラルや Regexp.new などで正規表現
オブジェクトを得ることができます...
...# -*- coding:utf-8 -*-
/あいう/.encoding # => #<Encoding:UTF-8>
/abc/.encoding # => #<Encoding:US-ASCII>
/abc/u.encoding # => #<Encoding:UTF-8>
//}

正規表現のエンコーディングと文字列のエンコーディングが非互換で
ある場合、Encoding::CompatibilityError が発生...