Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

class method

Encoding.name_list

() -> ::Array[::String]
Encoding.name_list → ["enc1", "enc2", ...]

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"]
See also .locale_charmap #ascii_compatible? .list #dummy? also in 4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0