るりまサーチ

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

別のキーワード

  1. io popen
  2. io pipe
  3. io each_line
  4. io readlines
  5. io each

検索結果

Encoding::UndefinedConversionError (12032.0)

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

...生する例外。

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

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


変換が多段階でなされ、その途中で例...
...UC-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
$!....
...source_encoding_name #=> "UTF-8"
p
$!.destination_encoding_name #=> "EUC-JP"
p
uts $!.error_char.dump #=> "\u{a0}"
p
$!.error_char.encoding #=> #<Encoding:UTF-8>
end
//}...

Encoding::Converter#primitive_convert(source_buffer, destination_buffer, destination_byteoffset, destination_bytesize, options) -> Symbol (6526.0)

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

...ng::Converter#primitive_convert が唯一の方法になります。

@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesize...
...@param options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol

options には以下が指定できます。

: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion aft...
...put before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT

戻り値は以下のうちのどれかです。

* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_emp...

Encoding::Converter#primitive_convert(source_buffer, destination_buffer, destination_byteoffset, destination_bytesize) -> Symbol (6426.0)

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

...ng::Converter#primitive_convert が唯一の方法になります。

@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesize...
...@param options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol

options には以下が指定できます。

: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion aft...
...put before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT

戻り値は以下のうちのどれかです。

* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_emp...

Encoding::Converter#primitive_convert(source_buffer, destination_buffer, destination_byteoffset) -> Symbol (6326.0)

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

...ng::Converter#primitive_convert が唯一の方法になります。

@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesize...
...@param options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol

options には以下が指定できます。

: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion aft...
...put before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT

戻り値は以下のうちのどれかです。

* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_emp...

Encoding::Converter#primitive_convert(source_buffer, destination_buffer) -> Symbol (6226.0)

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

...ng::Converter#primitive_convert が唯一の方法になります。

@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesize...
...@param options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol

options には以下が指定できます。

: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion aft...
...put before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT

戻り値は以下のうちのどれかです。

* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_emp...

絞り込み条件を変える

Encoding::Converter.new(source_encoding, destination_encoding, options) -> Encoding::Converter (338.0)

Encoding::Converter オブジェクトを作成します。

...ェクトを作成します。

@param source_encoding 変換元のエンコーディング
@param destination_encoding 変換先のエンコーディング
@param options 変換の詳細を指定する定数やハッシュ
@param convpath 変換経路の配列

options では String#encode での...
...ハッシュオプションに加えて、以下の定数が利用可能です。

* Encoding::Converter::INVALID_REPLACE
* Encoding::Converter::UNDEF_REPLACE
* Encoding::Converter::UNDEF_HEX_CHARREF
* Encoding::Converter::UNIVERSAL_NEWLINE_DECORATOR
* Encoding::Converter::CRLF_NEWLINE_DEC...
...orators such as newline conversion are inserted last.
ec = Encoding::Converter.new("UTF-16BE", "UTF-8", :universal_newline => true)
p
ec.convpath #=> [[#<Encoding:UTF-16BE>, #<Encoding:UTF-8>],
# "universal_newline"]

# But, if the last encoding is ASCII incompatible,
# decorators a...

Encoding::Converter.new(source_encoding, destination_encoding) -> Encoding::Converter (138.0)

Encoding::Converter オブジェクトを作成します。

...ェクトを作成します。

@param source_encoding 変換元のエンコーディング
@param destination_encoding 変換先のエンコーディング
@param options 変換の詳細を指定する定数やハッシュ
@param convpath 変換経路の配列

options では String#encode での...
...ハッシュオプションに加えて、以下の定数が利用可能です。

* Encoding::Converter::INVALID_REPLACE
* Encoding::Converter::UNDEF_REPLACE
* Encoding::Converter::UNDEF_HEX_CHARREF
* Encoding::Converter::UNIVERSAL_NEWLINE_DECORATOR
* Encoding::Converter::CRLF_NEWLINE_DEC...
...orators such as newline conversion are inserted last.
ec = Encoding::Converter.new("UTF-16BE", "UTF-8", :universal_newline => true)
p
ec.convpath #=> [[#<Encoding:UTF-16BE>, #<Encoding:UTF-8>],
# "universal_newline"]

# But, if the last encoding is ASCII incompatible,
# decorators a...