+ /* Catch a few Shift-JIS strays */
+ if (guess == 0 || guess == kTextEncodingMacUnicode) {
+ if (ch == 0x2010 || ch == 0x2014 || ch == 0x2015 || ch == 0x2016) {
+ guess = kTextEncodingMacJapanese;
+ if ((cjkstate == 0) || (cjkstate & CJK_JAPAN))
+ cjkstate = CJK_JAPAN;
+ else
+ cjkstate |= CJK_JAPAN;
+ continue;
+ }
+ if ((hfs_encodingbias == kTextEncodingMacJapanese) &&
+ (ch == 0x00A2 || ch == 0x00A3 || ch == 0x00AC)) {
+ guess = kTextEncodingMacJapanese;
+ continue;
+ }
+ /* TM char depends on the Mac encoding used. */
+ if (ch == 0x2122) {
+ switch(hfs_encodingbias) {
+ case kTextEncodingMacJapanese:
+ case kTextEncodingMacChineseTrad:
+ case kTextEncodingMacKorean:
+ case kTextEncodingMacGreek:
+ case kTextEncodingMacThai:
+ case kTextEncodingMacChineseSimp:
+ guess = hfs_encodingbias;
+ break;
+ }
+ }
+ }