----------------------------------------------------------------------
($pos)
| 64 | |
| 65 | //---------------------------------------------------------------------- |
| 66 | public function identifyMode($pos) |
| 67 | { |
| 68 | if ($pos >= strlen($this->dataStr)) |
| 69 | return QR_MODE_NUL; |
| 70 | |
| 71 | $c = $this->dataStr[$pos]; |
| 72 | |
| 73 | if(self::isdigitat($this->dataStr, $pos)) { |
| 74 | return QR_MODE_NUM; |
| 75 | } else if(self::isalnumat($this->dataStr, $pos)) { |
| 76 | return QR_MODE_AN; |
| 77 | } else if($this->modeHint == QR_MODE_KANJI) { |
| 78 | |
| 79 | if ($pos+1 < strlen($this->dataStr)) |
| 80 | { |
| 81 | $d = $this->dataStr[$pos+1]; |
| 82 | $word = (ord($c) << 8) | ord($d); |
| 83 | if(($word >= 0x8140 && $word <= 0x9ffc) || ($word >= 0xe040 && $word <= 0xebbf)) { |
| 84 | return QR_MODE_KANJI; |
| 85 | } |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | return QR_MODE_8; |
| 90 | } |
| 91 | |
| 92 | //---------------------------------------------------------------------- |
| 93 | public function eatNum() |