Class | CharDet::EUCKRDistributionAnalysis
In: | lib/tmail/vendor/rchardet-1.3/lib/rchardet/chardistribution.rb
Parent: | CharDistributionAnalysis

### Methods

get_order new

### Public Class methods

new()

[Source]

    # File lib/tmail/vendor/rchardet-1.3/lib/rchardet/chardistribution.rb, line 123
        def initialize
          super()
          @_mCharToFreqOrder = EUCKRCharToFreqOrder
          @_mTableSize = EUCKR_TABLE_SIZE
          @_mTypicalDistributionRatio = EUCKR_TYPICAL_DISTRIBUTION_RATIO
        end

### Public Instance methods

get_order(aStr)

[Source]

    # File lib/tmail/vendor/rchardet-1.3/lib/rchardet/chardistribution.rb, line 130
        def get_order(aStr)
          # for euc-KR encoding, we are interested
          #   first  byte range: 0xb0 -- 0xfe
          #   second byte range: 0xa1 -- 0xfe
          # no validation needed here. State machine has done that
          if aStr[0..0] >= "\xB0"
            return 94 * (aStr[0] - 0xB0) + aStr[1] - 0xA1
          else
            return -1
          end
        end

[Validate]