----------------------------------------------------------------------
($pos)
| 2001 | |
| 2002 | //---------------------------------------------------------------------- |
| 2003 | public function identifyMode($pos) |
| 2004 | { |
| 2005 | if ($pos >= strlen($this->dataStr)) |
| 2006 | return QR_MODE_NUL; |
| 2007 | |
| 2008 | $c = $this->dataStr[$pos]; |
| 2009 | |
| 2010 | if(self::isdigitat($this->dataStr, $pos)) { |
| 2011 | return QR_MODE_NUM; |
| 2012 | } else if(self::isalnumat($this->dataStr, $pos)) { |
| 2013 | return QR_MODE_AN; |
| 2014 | } else if($this->modeHint == QR_MODE_KANJI) { |
| 2015 | |
| 2016 | if ($pos+1 < strlen($this->dataStr)) |
| 2017 | { |
| 2018 | $d = $this->dataStr[$pos+1]; |
| 2019 | $word = (ord($c) << 8) | ord($d); |
| 2020 | if(($word >= 0x8140 && $word <= 0x9ffc) || ($word >= 0xe040 && $word <= 0xebbf)) { |
| 2021 | return QR_MODE_KANJI; |
| 2022 | } |
| 2023 | } |
| 2024 | } |
| 2025 | |
| 2026 | return QR_MODE_8; |
| 2027 | } |
| 2028 | |
| 2029 | //---------------------------------------------------------------------- |
| 2030 | public function eatNum() |