るりまサーチ (Ruby 2.4.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.033秒)
トップページ > バージョン:2.4.0[x] > ライブラリ:ビルトイン[x] > クエリ:CP932[x] > クエリ:InvalidByteSequenceError[x]

別のキーワード

  1. win32ole cp_oemcp
  2. win32ole cp_maccp
  3. win32ole cp_utf8
  4. win32ole cp_thread_acp
  5. win32ole cp_utf7

検索結果

Encoding::InvalidByteSequenceError (54043.0)

文字列がそのエンコーディングにおいて不正なバイト列である場合に発生 する例外。

文字列がそのエンコーディングにおいて不正なバイト列である場合に発生
する例外。

通常エンコーディング変換時に発生します。

//emlist[例][ruby]{
"\x82\xa0".force_encoding("cp932").encode("UTF-8")
#=> "あ"
"\x82\xa0".force_encoding("EUC-JP").encode("UTF-8")
#=> Encoding::InvalidByteSequenceError: "\x82" on EUC-JP
//}