49件ヒット
[1-49件を表示]
(0.170秒)
検索結果
先頭5件
-
IO
# set _ encoding(enc _ str , **opts) -> self (18216.0) -
IO のエンコーディングを設定します。
...oding オブジェクトを指定します。
@param int_enc 内部エンコーディングを表す文字列か Encoding オブジェクトを指定します。
@param opts エンコーディング変換のオプション
例:
io = File.open(file)
io.set_encoding("ASCII-8BIT", "EUC-JP")......coding オブジェクトを指定します。
@param int_enc 内部エンコーディングを表す文字列か Encoding オブジェクトを指定します。
@param opts エンコーディング変換のオプション
例:
io = File.open(file)
io.set_encoding("ASCII-8BIT", "EUC-JP")... -
IO
# set _ encoding(ext _ enc) -> self (18216.0) -
IO のエンコーディングを設定します。
...oding オブジェクトを指定します。
@param int_enc 内部エンコーディングを表す文字列か Encoding オブジェクトを指定します。
@param opts エンコーディング変換のオプション
例:
io = File.open(file)
io.set_encoding("ASCII-8BIT", "EUC-JP")......coding オブジェクトを指定します。
@param int_enc 内部エンコーディングを表す文字列か Encoding オブジェクトを指定します。
@param opts エンコーディング変換のオプション
例:
io = File.open(file)
io.set_encoding("ASCII-8BIT", "EUC-JP")... -
IO
# set _ encoding(ext _ enc , int _ enc , **opts) -> self (18216.0) -
IO のエンコーディングを設定します。
...oding オブジェクトを指定します。
@param int_enc 内部エンコーディングを表す文字列か Encoding オブジェクトを指定します。
@param opts エンコーディング変換のオプション
例:
io = File.open(file)
io.set_encoding("ASCII-8BIT", "EUC-JP")......coding オブジェクトを指定します。
@param int_enc 内部エンコーディングを表す文字列か Encoding オブジェクトを指定します。
@param opts エンコーディング変換のオプション
例:
io = File.open(file)
io.set_encoding("ASCII-8BIT", "EUC-JP")... -
IO
# set _ encoding _ by _ bom -> Encoding | nil (6226.0) -
BOM から IO のエンコーディングを設定します。
...場合は nil を返します。
自身がバイナリモードでないかすでにエンコーディングがセットされている場合、例外が発生します。
//emlist[例][ruby]{
File.write("bom.txt", "\u{FEFF}abc")
File.open("bom.txt", "rb") do |io|
p io.set_encoding_by_bom #=>......#<Encoding:UTF-8>
str = io.read
p str #=> "abc"
p str.encoding #=> #<Encoding:UTF-8>
end
File.write("nobom.txt", "abc")
File.open("nobom.txt", "rb") do |io|
p io.set_encoding_by_bom #=> nil
end
//}... -
IO
# internal _ encoding -> Encoding | nil (6113.0) -
IO の内部エンコーディングを返します。 内部エンコーディングが指定されていない場合は nil を返します。
...エンコーディングが指定されていない場合は nil を返します。
//emlist[例][ruby]{
IO.write("testfile", "abcde")
File.open("testfile") do |f|
p f.internal_encoding # => nil
f.set_encoding("ASCII-8BIT", "EUC-JP")
p f.internal_encoding # => #<Encoding:EUC-JP>
end
//}...