Methods

Class/Module Index [+]

Quicksearch

CharDet::EUCJPDistributionAnalysis

Public Class Methods

new() click to toggle source
# File lib/tmail/vendor/rchardet-1.3/lib/rchardet/chardistribution.rb, line 219
def initialize
  super()
  @_mCharToFreqOrder = JISCharToFreqOrder
  @_mTableSize = JIS_TABLE_SIZE
  @_mTypicalDistributionRatio = JIS_TYPICAL_DISTRIBUTION_RATIO
end

Public Instance Methods

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

[Validate]

Generated with the Darkfish Rdoc Generator 2.