| 123 | }; |
| 124 | |
| 125 | inline UtfIntroCharType IntroCharTypeOf(std::istream::int_type ch) { |
| 126 | if (std::istream::traits_type::eof() == ch) { |
| 127 | return uictOther; |
| 128 | } |
| 129 | |
| 130 | switch (ch) { |
| 131 | case 0: |
| 132 | return uict00; |
| 133 | case 0xBB: |
| 134 | return uictBB; |
| 135 | case 0xBF: |
| 136 | return uictBF; |
| 137 | case 0xEF: |
| 138 | return uictEF; |
| 139 | case 0xFE: |
| 140 | return uictFE; |
| 141 | case 0xFF: |
| 142 | return uictFF; |
| 143 | } |
| 144 | |
| 145 | if ((ch > 0) && (ch < 0xFF)) { |
| 146 | return uictAscii; |
| 147 | } |
| 148 | |
| 149 | return uictOther; |
| 150 | } |
| 151 | |
| 152 | inline char Utf8Adjust(unsigned long ch, unsigned char lead_bits, |
| 153 | unsigned char rshift) { |