instance method
get_order
Ruby on Rails 2.3.18
Since v2.3.18 Last seen in v2.3.18Signature
get_order(aStr)
No documentation comment.
Parameters
-
aStrreq
Source
# File actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/chardistribution.rb, line 197
def get_order(aStr)
# for sjis encoding, we are interested
# first byte range: 0x81 -- 0x9f , 0xe0 -- 0xfe
# second byte range: 0x40 -- 0x7e, 0x81 -- oxfe
# no validation needed here. State machine has done that
aStr = aStr[0..1].join if aStr.class == Array
if (aStr[0..0] >= "\x81") and (aStr[0..0] <= "\x9F")
order = 188 * (aStr[0] - 0x81)
elsif (aStr[0..0] >= "\xE0") and (aStr[0..0] <= "\xEF")
order = 188 * (aStr[0] - 0xE0 + 31)
else
return -1
end
order = order + aStr[1] - 0x40
if aStr[1..1] > "\x7F"
order =- 1
end
return order
end
Defined in actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/chardistribution.rb line 197
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in CharDet::SJISDistributionAnalysis