るりまサーチ

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

別のキーワード

  1. drb install_id_conv
  2. drb default_id_conv
  3. drbserver default_id_conv
  4. install_id_conv drb
  5. default_id_conv drb

ライブラリ

検索結果

Encoding::UndefinedConversionError (6019.0)

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

...g::UndefinedConversionError: U+2603 from UTF-8 to EUC-JP
//}


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

//emlist[例][ruby]{
ec = Encoding::Converter.new("ISO-8859-...
...EUC-JP
begin
ec.convert("\xa0")
# NO-BREAK SPACE, which is available in UTF-8 but not in EUC-JP.
rescue Encoding::UndefinedConversionError
p $!.source_encoding #=> #<Encoding:UTF-8>
p $!.destination_encoding #=> #<Encoding:EUC-JP>
p $!.source_encoding_name #=>...