るりまサーチ

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

別のキーワード

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

ライブラリ

キーワード

検索結果

IO (38463.0)

基本的な入出力機能のためのクラスです。

...基本的な入出力機能のためのクラスです。


File::Constants は、File から IO へ移動しました。

===[a:m17n] 多言語化と IO のエンコーディング

IO
オブジェクトはエンコーディングを持ちます。
エンコーディングの影響を受けるメ...
...と受けないメソッドがあります。

影響を受けるメソッドでは、IO のエンコーディングに従い読み込まれた文字列のエンコーディングが決定されます。
また IO のエンコーディングを適切に設定することにより、読み込み時...
...いメソッド

IO
の読み込みメソッドは2種類存在します。
テキスト読み込みメソッドとバイナリ読み込みメソッドです。

テキスト読み込みメソッドは IO のエンコーディングの影響をうけます。
詳しくは「io_encoding」を参照...

Encoding::UndefinedConversionError (9073.0)

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

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

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


変換が多段階でなされ、その途中で例外が生じた場合は、
...
...e 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"
puts $!.erro...
...r_char.dump #=> "\u{a0}"
p $!.error_char.encoding #=> #<Encoding:UTF-8>
end
//}...

Encoding (6037.0)

文字エンコーディング(文字符号化方式)のクラスです。Rubyの多言語対応(M17N)機能において利用されます。

...ンコーディングによるものであるかも併せて保持しています。この情報は String#encoding により取得できます。 Encoding オブジェクトを返すメソッドにはこの他に IO#internal_encoding, IO#external_encoding などがあります。

@see spec/m17n...

REXML::Instruction (6007.0)

XML 処理命令(XML Processing Instruction, XML PI)を表すクラス。

...令(XML Processing Instruction, XML PI)を表すクラス。

XML 処理命令 とは XML 文書中の <? と ?> で挟まれた部分のことで、
アプリケーションへの指示を保持するために使われます。

XML 宣言(文書先頭の <?xml version=... ?>)はXML処理命令で...
...せんが、
似た見た目を持っています。

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/css" href="style.css"?>
<root />
EOS
doc[2] # => <?p-i xml-stylesheet ...?>
doc[2].target # => "xml-st...

CSV (85.0)

このクラスは CSV ファイルやデータに対する完全なインターフェイスを提供します。

...ターフェイスを提供します。

=== 読み込み

//emlist[][ruby]{
require "csv"

csv_text = <<~CSV_TEXT
Ruby,1995
Rust,2010
CSV_TEXT

IO
.write "sample.csv", csv_text

# ファイルから一行ずつ
CSV.foreach("sample.csv") do |row|
p row
end
# => ["Ruby", "1995"]
# ["Rust", "2...
...17n or Multilingualization)

This new CSV parser is m17n savvy. The parser works in the Encoding of the IO
or String object being read from or written to. Your data is never transcoded
(unless you ask Ruby to transcode it for you) and will literally be parsed in
the Encoding it is in. Thus CSV wi...
...ll return Arrays or Rows of Strings in the
Encoding
of your data. This is accomplished by transcoding the parser itself
into your Encoding.

Some transcoding must take place, of course, to accomplish this multiencoding
support. For example, <tt>:col_sep</tt>, <tt>:row_sep</tt>, and
<tt>:quote_char...

絞り込み条件を変える