Skip to content

End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

class method

Encoding.aliases

Encoding.aliases → {"alias1" => "orig1", "alias2" => "orig2", ...}

Returns the hash of available encoding alias and original encoding name.

Encoding.aliases
#=> {"BINARY"=>"ASCII-8BIT", "ASCII"=>"US-ASCII", "ANSI_X3.4-1968"=>"US-ASCII",
      "SJIS"=>"Windows-31J", "eucJP"=>"EUC-JP", "CP932"=>"Windows-31J"}
See also .compatible? .default_external also in 4.1 · 4.0 · 3.4 · 3.3 · 3.1 · 3.0