るりまサーチ

最速Rubyリファレンスマニュアル検索!
374件ヒット [101-200件を表示] (0.056秒)

別のキーワード

  1. string encode
  2. _builtin encode
  3. string encode!
  4. base64 encode64
  5. _builtin encode!

検索結果

<< < 1 2 3 4 > >>

Encoding.default_internal -> Encoding | nil (14.0)

既定の内部エンコーディングを返します。デフォルトでは nil です。

...ファイルなどで、内部エンコーディングが指定されていない場合の既定値として利用されます。

String#encode と String#encode! は、引数に Encoding が与えられていない場合、 default_internal を使用します。

文字列リテラルを作成し...

Encoding::CompatibilityError (14.0)

2つのエンコーディング間に互換性がない場合に発生する例外。

...い場合に発生する例外。

エンコーディングの異なる文字列を連結しようとした場合などに発生します。

//emlist[例][ruby]{
"あ".encode("EUC-JP") + "あ".encode("UTF-8")
#=> Encoding::CompatibilityError: incompatible character encodings: EUC-JP and UTF-8
//}...

Encoding::InvalidByteSequenceError (14.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
//}...

Encoding::Converter (8.0)

文字エンコーディング(文字符号化方式)の変換器のクラスです。既存の変換器より一段細かな処理が可能となります。

...nverter を用いて変換を行う場合は、Encoding::Converter#convert か、より細かな変換処理が可能な Encoding::Converter#primitive_convert が利用できます。
エンコーディングを変換するメソッドはこの他に String#encode, NKF.#nkf
などがあります。...

Encoding::Converter.new(convpath) -> Encoding::Converter (8.0)

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

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

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

* Encoding::Converter::INVALID_REPLACE
* Encoding::Co...

絞り込み条件を変える

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

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

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

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

* Encoding::Converter::INVALID_REPLACE
* Encoding::Co...

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

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

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

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

* Encoding::Converter::INVALID_REPLACE
* Encoding::Co...

Encoding::ConverterNotFoundError (8.0)

指定した名前のエンコーディング変換をする変換器が 存在しない場合に発生する例外。

...指定した名前のエンコーディング変換をする変換器が
存在しない場合に発生する例外。

//emlist[例][ruby]{
"あ".encode("Foo")
#=> Encoding::ConverterNotFoundError: code converter not found (UTF-8 to Foo)
//}...

Encoding::UndefinedConversionError (8.0)

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

...する例外。

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

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


変換が多段階でなされ、その途中で例外...

IO#set_encoding(enc_str, **opts) -> self (8.0)

IO のエンコーディングを設定します。

...で外部エンコーディングを内部エンコーディングに変換する際の
オプションを指定します。
詳しくは String#encode を参照してください。

@param enc_str エンコーディングを表す文字列を指定します。"A:B" のようにコロンで区切...

絞り込み条件を変える

<< < 1 2 3 4 > >>