| 62 | } |
| 63 | |
| 64 | int Utf8BytesIndicated(char ch) { |
| 65 | int byteVal = static_cast<unsigned char>(ch); |
| 66 | switch (byteVal >> 4) { |
| 67 | case 0: |
| 68 | case 1: |
| 69 | case 2: |
| 70 | case 3: |
| 71 | case 4: |
| 72 | case 5: |
| 73 | case 6: |
| 74 | case 7: |
| 75 | return 1; |
| 76 | case 12: |
| 77 | case 13: |
| 78 | return 2; |
| 79 | case 14: |
| 80 | return 3; |
| 81 | case 15: |
| 82 | return 4; |
| 83 | default: |
| 84 | return -1; |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | bool IsTrailingByte(char ch) { return (ch & 0xC0) == 0x80; } |
| 89 |
no outgoing calls
no test coverage detected