Ruby 1.9.2 リファレンスマニュアル > ライブラリ一覧 > 組み込みライブラリ > Encodingクラス
クラスの継承リスト: Encoding < Object < Kernel < BasicObject
文字エンコーディング(文字符号化方式)のクラスです。Rubyの多言語対応(M17N)機能において利用されます。
例えば文字列オブジェクトは、文字列のバイト表現の他にそのバイト表現がどのエンコーディングによるものであるかも併せて保持しています。この情報は String#encoding により取得できます。 Encoding オブジェクトを返すメソッドにはこの他に IO#internal_encoding, IO#external_encoding などがあります。
@see 多言語化
定義 | 説明 | |
---|---|---|
aliases -> Hash
|
エンコーディングの別名に対して元の名前を対応づけるハッシュを返します。 |
|
compatible?(str1, str2) -> Encoding | nil
|
2つの文字列に互換性があるかどうかをチェックします。互換性がある文字列は 結合させることができます。互換性があるときは、結合後の文字列が取るであ ろう Encoding オブジェクトを返します。互換性がない場合は nil を返します。 |
|
default_external -> Encoding
|
規定の外部エンコーディングを返します。 |
|
default_external=(encoding)
|
規定の外部エンコーディングを設定します。 |
|
default_internal -> Encoding | nil
|
規定の内部エンコーディングを返します。 |
|
default_internal=(encoding)
|
規定の内部エンコーディングを設定します。 |
|
find(name) -> Encoding
|
指定された name という名前を持つ Encoding オブジェクトを返します。 |
|
list -> [Encoding]
|
現在ロードされているエンコーディングのリストを返します。 |
|
locale_charmap -> String | nil
|
ロケールエンコーディングを決定するために用いる、locale charmap 名を返します。nl_langinfo 等がない環境では nil を、miniruby では ASCII_8BIT を返します。 |
|
name_list -> [String]
|
利用可能なエンコーディングの名前を文字列の配列で返します。 |
定義 | 説明 | |
---|---|---|
ascii_compatible? -> bool
|
Returns whether ASCII-compatible or not. |
|
dummy? -> bool
|
自身がダミーエンコーディングである場合に true を返します。 そうでない場合に false を返します。 |
|
inspect -> String
|
プログラマにわかりやすい表現の文字列を返します。 |
|
name -> String
|
エンコーディングの名前を返します。 |
|
names -> String
|
エンコーディングの名前とエイリアス名の配列を返します。 |
|
replicate(name) -> Encoding
|
レシーバのエンコーディングを複製(replicate)します。 複製されたエンコーディングは元のエンコーディングと同じバイト構造を持たなければなりません。 name という名前のエンコーディングが既に存在する場合は ArgumentError を発生します。 |
!
!=
==
===
=~
__id__
__send__
_dump
class
clone
dclone
display
enum_for
eql?
equal?
extend
freeze
frozen?
hash
initialize
initialize_copy
instance_eval
instance_exec
instance_of?
instance_variable_defined?
instance_variable_get
instance_variable_set
instance_variables
is_a?
marshal_dump
marshal_load
method
method_missing
methods
must_be
must_be_close_to
must_be_empty
must_be_instance_of
must_be_kind_of
must_be_nil
must_be_same_as
must_be_within_epsilon
must_equal
must_include
must_match
must_raise
must_respond_to
must_send
must_throw
nil?
pretty_inspect
pretty_print
pretty_print_cycle
pretty_print_inspect
pretty_print_instance_variables
private_methods
protected_methods
public_methods
remove_instance_variable
respond_to?
respond_to_missing?
singleton_class
singleton_method_added
singleton_method_removed
singleton_method_undefined
singleton_methods
taint
tainted?
tap
to_a
to_ary
to_hash
to_int
to_io
to_proc
to_regexp
to_str
to_yaml
to_yaml_properties
to_yaml_style
trust
untaint
untrust
untrusted?
wont_be
wont_be_close_to
wont_be_empty
wont_be_instance_of
wont_be_kind_of
wont_be_nil
wont_be_same_as
wont_be_within_epsilon
wont_equal
wont_include
wont_match
wont_respond_to
.new