Method: Encoding::CodePage#codepage

Defined in:
lib/encoding-codepage.rb

#codepage(id) ⇒ Object

Find an Encoding object from a Micrsoft® Code Page Identifier.

A list of Code Page identifiers can be found at:

NOTE: This library doesn’t add support for all Code Pages, it merely allows you to look up existing encodings by their Code Page Identifier.

Parameters:

  • Integer

    The Code Page Identifier.

Returns:

  • Encoding The Encoding object.

Raises:

  • ArgumentError The Code Page you tried to find doesn’t exist.



24
25
26
# File 'lib/encoding-codepage.rb', line 24

def codepage(id)
  Encoding.find("CP#{id}")
end