Module: Encoding::CodePageMethods
- Included in:
- Encoding
- Defined in:
- lib/encoding-codepage.rb
Instance Method Summary collapse
-
#codepage_id ⇒ Object
Find the code-page id that corresponds to this encoding.
Instance Method Details
#codepage_id ⇒ Object
Find the code-page id that corresponds to this encoding.
85 86 87 88 89 90 91 92 93 |
# File 'lib/encoding-codepage.rb', line 85 def codepage_id if names.detect{ |x| x =~ /\ACP([0-9]+)\z/ } Integer($1, 10) elsif codepage_encoding = CodePage.reverse_lookup[self] codepage_encoding.codepage_id else raise ArgumentError, "No Code Page Idenfier found for: #{self}" end end |