Thanks to visit codestin.com
Credit goes to github.com

Skip to content

NKF constants #338

@kachick

Description

@kachick

I noticed the following behavior when using NKF.guess.

Code

require 'nkf'

NKF.constants(true).sort.each do |cons|
  puts "#{cons} => #{NKF.const_get(cons).inspect}"
end

Result

ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]

ASCII => #<Encoding:US-ASCII>
AUTO => nil
BINARY => #<Encoding:ASCII-8BIT>
EUC => #<Encoding:EUC-JP>
JIS => #<Encoding:ISO-2022-JP (dummy)>
NKF_RELEASE_DATE => "2011-09-08"
NKF_VERSION => "2.1.2"
NOCONV => nil
SJIS => #<Encoding:Shift_JIS>
UNKNOWN => nil
UTF16 => #<Encoding:UTF-16BE>
UTF32 => #<Encoding:UTF-32BE>
UTF8 => #<Encoding:UTF-8>
VERSION => "2.1.2 (2011-09-08)"

jruby 1.7.0.RC1 (1.9.3p203) 2012-10-09 689e08f on OpenJDK 64-Bit Server VM 1.6.0_24-b24 [linux-amd64]

ASCII => 5
AUTO => 0
BASE64 => 20
BINARY => 4
EUC => 2
JIS => 1
MIME_DETECT => 22
NOCONV => 4
OTHER => 16
QENCODE => 21
SJIS => 3
UNKNOWN => 0
UTF16 => 8
UTF32 => 12
UTF8 => 6

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions