enc.name â string Instance Public methods Returns the name of the encoding. Encoding::UTF_8.name #=> "UTF-8"
enc.replicate(name) â encoding Instance Public methods Returns a replicated encoding of enc whose name is name. The new encoding should have the same byte structure of enc. If name is used by another encoding, raise ArgumentError.
enc.names â array Instance Public methods Returns the list of name and aliases of the encoding. Encoding::WINDOWS_31J.names #=> ["Windows-31J", "CP932", "csWindows31J"]
enc.inspect â string Instance Public methods Returns a string which represents the encoding for programmers. Encoding::UTF_8.inspect #=> "#<Encoding:UTF-8>" Encoding::ISO_2022_JP.inspect #=> "#<Encoding:ISO-2022-JP (dummy)>"
enc.dummy? â true or false Instance Public methods Returns true for dummy encodings. A dummy encoding is an encoding for which character handling is not properly implemented. It is used for stateful encodings. Encoding::ISO_2022_JP.dummy? #=> true Encoding::UTF_8.dummy? #=> false
enc.ascii_compatible? â true or false Instance Public methods Returns whether ASCII-compatible or not. Encoding::UTF_8.ascii_compatible? #=> true Encoding::UTF_16BE.ascii_compatible? #=> false
Encoding.name_list â ["enc1", "enc2", ...] Class Public methods Returns the list of available encoding names. Encoding.name_list #=> ["US-ASCII", "ASCII-8BIT", "UTF-8", "ISO-8859-1", "Shift_JIS", "EUC-JP", "Windows-31J", "BINARY", "CP932", "eucJP"]
Encoding.locale_charmap â string Class Public methods Returns the locale charmap name. It returns nil if no appropriate information. Debian GNU/Linux LANG=C Encoding.locale_charmap #=> "ANSI_X3.4-1968" LANG=ja_JP.EUC-JP Encoding.locale_charmap #=> "EUC-JP" SunOS 5 LANG=C Encoding.locale_charmap #=> "646" LANG=ja Encoding.locale_charmap #=> "eucJP" The result is highly platform dependent. So ::find may cause an error. If you need some encod
Encoding.list â [enc1, enc2, ...] Class Public methods Returns the list of loaded encodings. Encoding.list #=> [#<Encoding:ASCII-8BIT>, #<Encoding:UTF-8>, #<Encoding:ISO-2022-JP (dummy)>] Encoding.find("US-ASCII") #=> #<Encoding:US-ASCII> Encoding.list #=> [#<Encoding:ASCII-8BIT>, #<Encoding:UTF-8>, #<Encoding:US-ASCII>, #<Encoding:ISO-2022-JP (dummy)>]
Page 2128 of 2275