| 109 | |
| 110 | |
| 111 | int DoubleByteEncoding::queryConvert(const unsigned char* bytes, int length) const |
| 112 | { |
| 113 | int n = _charMap[*bytes]; |
| 114 | switch (n) |
| 115 | { |
| 116 | case -1: |
| 117 | return -1; |
| 118 | case -2: |
| 119 | if (length >= 2) |
| 120 | return map((bytes[0] << 8) | bytes[1]); |
| 121 | else |
| 122 | return -2; |
| 123 | default: |
| 124 | return n; |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | |
| 129 | int DoubleByteEncoding::sequenceLength(const unsigned char* bytes, int length) const |