77件ヒット
[1-77件を表示]
(0.052秒)
別のキーワード
種類
- インスタンスメソッド (55)
- クラス (22)
クラス
キーワード
- UndefinedConversionError (11)
-
destination
_ encoding (11) -
destination
_ encoding _ name (11) -
error
_ char (11) -
source
_ encoding (11) -
source
_ encoding _ name (11)
検索結果
先頭5件
-
RSS
:: ConversionError (30000.0) -
-
Encoding
:: UndefinedConversionError (18000.0) -
エンコーディング変換後の文字が存在しない場合に発生する例外。
...ding::UndefinedConversionError: U+2603 from UTF-8 to EUC-JP
//}
変換が多段階でなされ、その途中で例外が生じた場合は、
例外オブジェクトが保持するエラー情報はその中間のものになります。
//emlist[例][ruby]{
ec = Encoding::Converter.new("ISO-88......-JP")
# ISO-8859-1 -> UTF-8 -> 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 $!.so......urce_encoding_name #=> "UTF-8"
p $!.destination_encoding_name #=> "EUC-JP"
puts $!.error_char.dump #=> "\u{a0}"
p $!.error_char.encoding #=> #<Encoding:UTF-8>
end
//}... -
Encoding
:: UndefinedConversionError # destination _ encoding -> Encoding (15100.0) -
エラーを発生させた変換の変換先のエンコーディングを Encoding オブジェクトで返します。
...エラーを発生させた変換の変換先のエンコーディングを Encoding
オブジェクトで返します。
@see Encoding::UndefinedConversionError#source_encoding... -
Encoding
:: UndefinedConversionError # destination _ encoding _ name -> String (15100.0) -
エラーを発生させた変換の変換先のエンコーディングを文字列で返します。
...エラーを発生させた変換の変換先のエンコーディングを文字列で返します。
@see Encoding::UndefinedConversionError#destination_encoding... -
Encoding
:: UndefinedConversionError # error _ char -> String (9000.0) -
エラーを発生させた1文字を文字列で返します。
...エラーを発生させた1文字を文字列で返します。
//emlist[例][ruby]{
ec = Encoding::Converter.new("UTF-8", "EUC-JP")
begin
ec.convert("\u{a0}")
rescue Encoding::UndefinedConversionError
puts $!.error_char.dump #=> "\u{a0}"
end
//}... -
Encoding
:: UndefinedConversionError # source _ encoding -> Encoding (9000.0) -
エラーを発生させた変換の変換元のエンコーディングを Encoding オブジェクトで返します。
...ーディングを Encoding
オブジェクトで返します。
変換が多段階になされる場合は元の文字列のものではない
エンコーディングが返される場合があることに注意してください。
@see Encoding::UndefinedConversionError#destination_encoding... -
Encoding
:: UndefinedConversionError # source _ encoding _ name -> Encoding (9000.0) -
エラーを発生させた変換の変換元のエンコーディングを文字列で返します。
...エラーを発生させた変換の変換元のエンコーディングを文字列で返します。
@see Encoding::UndefinedConversionError#source_encoding...