910件ヒット
[1-100件を表示]
(0.186秒)
別のキーワード
ライブラリ
- ビルトイン (682)
- csv (12)
- kconv (12)
-
net
/ http (72) - open-uri (24)
- psych (36)
-
rexml
/ document (60) -
webrick
/ httprequest (12)
クラス
-
ARGF
. class (12) - Array (21)
- CSV (12)
- Encoding (60)
-
Encoding
:: Converter (192) -
Encoding
:: InvalidByteSequenceError (24) -
Encoding
:: UndefinedConversionError (12) - IO (24)
- Integer (24)
-
Psych
:: Stream (24) -
Psych
:: Visitors :: YAMLTree (12) -
REXML
:: Document (36) -
REXML
:: Instruction (24) - String (283)
- Time (42)
-
WEBrick
:: HTTPRequest (12)
モジュール
-
Net
:: HTTPHeader (72) -
OpenURI
:: Meta (24)
キーワード
- << (12)
-
append
_ as _ bytes (1) - asctime (12)
- b (12)
- casecmp (12)
- chr (24)
- chunked? (12)
- concat (21)
- content (12)
-
content
_ encoding (12) - convert (12)
- convpath (12)
- ctime (12)
-
destination
_ encoding (12) - each (12)
-
each
_ capitalized _ name (12) -
each
_ header (12) -
each
_ key (12) -
each
_ name (12) - encode (36)
- encode! (24)
-
error
_ bytes (12) -
error
_ char (12) -
external
_ encoding (12) - finish (12)
-
force
_ encoding (12) -
incomplete
_ input? (12) -
insert
_ output (12) - inspect (30)
-
internal
_ encoding (24) - iseuc (12)
-
last
_ error (12) - name (12)
- names (12)
- pack (21)
-
primitive
_ convert (48) -
primitive
_ errinfo (12) - putback (24)
- query (12)
- replacement (12)
- replacement= (12)
- replicate (12)
- scrub (36)
- scrub! (36)
-
source
_ encoding (12) -
stand
_ alone? (12) - start (36)
- target (12)
-
to
_ s (24) -
unicode
_ normalize (11) -
unicode
_ normalize! (11) -
unicode
_ normalized? (11) - unpack (12)
-
valid
_ encoding? (12) - version (12)
検索結果
先頭5件
-
REXML
:: Document # encoding -> String (24320.0) -
XML 宣言に含まれている XML 文書のエンコーディングを返します。
...宣言を持たない場合はデフォルトの値
(REXML::XMLDecl.defaultで宣言されているもの)を返します。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<e />
EOS
doc.encoding # => "UTF-8"
//}... -
String
# encoding -> Encoding (24261.0) -
文字列のエンコーディング情報を表現した Encoding オブジェクトを返します。
...列のエンコーディング情報を表現した Encoding オブジェクトを返します。
//emlist[例][ruby]{
# encoding: utf-8
utf8_str = "test"
euc_str = utf8_str.encode("EUC-JP")
utf8_str.encoding # => #<Encoding:UTF-8>
euc_str.encoding # => #<Encoding:EUC-JP>
//}
@see Encoding... -
Encoding
:: Converter # destination _ encoding -> Encoding (21427.0) -
変換先のエンコーディングを返します。
...変換先のエンコーディングを返します。
@return 変換先のエンコーディング
//emlist[][ruby]{
ec = Encoding::Converter.new("utf-8", "euc-jp")
ec.destination_encoding #=> #<Encoding:EUC-JP>
//}... -
Encoding
# replicate(name) -> Encoding (21398.0) -
レシーバのエンコーディングを複製(replicate)します。 複製されたエンコーディングは元のエンコーディングと同じバイト構造を持たなければなりません。 name という名前のエンコーディングが既に存在する場合は ArgumentError を発生します。
...を複製(replicate)します。
複製されたエンコーディングは元のエンコーディングと同じバイト構造を持たなければなりません。
name という名前のエンコーディングが既に存在する場合は ArgumentError を発生します。
Ruby 3.2 から......Ruby 3.3 で削除予定です。
//emlist[][ruby]{
encoding = Encoding::UTF_8.replicate("REPLICATED_UTF-8") #=> #<Encoding:REPLICATED_UTF-8>
encoding.name #=> "REPLICATED_UTF-8"
"\u3042".force_encoding(Encoding::UTF_8).valid_encoding? #=> true......"\u3042".force_encoding(encoding).valid_encoding? #=> true
"\u3042".force_encoding(Encoding::SHIFT_JIS).valid_encoding? #=> false
//}... -
Encoding
:: InvalidByteSequenceError # error _ bytes -> String (21231.0) -
エラー発生時に捨てられたバイト列を返します。
...mlist[例][ruby]{
ec = Encoding::Converter.new("EUC-JP", "ISO-8859-1")
begin
ec.convert("abc\xA1\xFFdef")
rescue Encoding::InvalidByteSequenceError
p $!
#=> #<Encoding::InvalidByteSequenceError: "\xA1" followed by "\xFF" on EUC-JP>
puts $!.error_bytes.dump #=> "\xA1"
puts $!.reada......gain_bytes.dump #=> "\xFF"
end
//}
@see Encoding::InvalidByteSequenceError#readagain_bytes... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize , options) -> Symbol (18949.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...Encoding::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytes......aram options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after......output 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_... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize) -> Symbol (18849.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...Encoding::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytes......aram options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after......output 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_... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset) -> Symbol (18649.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...Encoding::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytes......aram options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after......output 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_... -
ARGF
. class # internal _ encoding -> Encoding | nil (18463.0) -
ARGF から読み込んだ文字列の内部エンコーディングを返します。 内部エンコーディングが指定されていない場合は nil を返します。
...ARGF から読み込んだ文字列の内部エンコーディングを返します。
内部エンコーディングが指定されていない場合は nil を返します。
まだ読み込み処理を始めていない場合は Encoding.default_external を返します。
ARGF.class#set_encod......$ ruby -Eutf-8 test.rb
# test.rb
ARGF.internal_encoding # => #<Encoding:UTF-8>
ARGF.set_encoding('utf-8','ascii')
ARGF.internal_encoding # => #<Encoding:US-ASCII>
例:
ARGF.binmode
ARGF.internal_encoding # => nil
@see IO, ARGF.class#external_encoding...