るりまサーチ (Ruby 2.1.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.062秒)
トップページ > 種類:クラス[x] > バージョン:2.1.0[x] > クエリ:UndefinedConversionError[x]

別のキーワード

  1. _builtin undefinedconversionerror
  2. undefinedconversionerror error_char
  3. undefinedconversionerror source_encoding
  4. undefinedconversionerror destination_encoding
  5. undefinedconversionerror source_encoding_name

ライブラリ

検索結果

Encoding::UndefinedConversionError (54040.0)

エンコーディング変換後の文字が存在しない場合に発生する例外。

エンコーディング変換後の文字が存在しない場合に発生する例外。

UTF-8 にしかない文字を EUC-JP に変換しようとした場合などに発生します。

//emlist[例][ruby]{
"\u2603".encode(Encoding::EUC_JP)
#=> Encoding::UndefinedConversionError: U+2603 from UTF-8 to EUC-JP
//}


変換が多段階でなされ、その途中で例外が生じた場合は、
例外オブジェクトが保持するエラー情報はその中間のものになります。

//emlist[例][ruby]{
ec = Encoding::Co...