| 115 | } |
| 116 | |
| 117 | int UArray_isMultibyte(const UArray *self) { |
| 118 | if (self->encoding == CENCODING_UTF8) { |
| 119 | size_t i, max = UArray_sizeInBytes(self); |
| 120 | const uint8_t *bytes = UArray_bytes(self); |
| 121 | for (i = 0; i < max; i++) { |
| 122 | if (UArray_SizeOfUTF8Char(bytes + i) > 1) |
| 123 | return 1; |
| 124 | } |
| 125 | // UARRAY_INTFOREACH(self, i, v, if (ismbchar((int)v)) return 1; ); |
| 126 | } |
| 127 | |
| 128 | return 0; |
| 129 | } |
| 130 | |
| 131 | int UArray_isLegalUTF8(const UArray *self) { |
| 132 | void *sourceStart = self->data; |
nothing calls this directly
no test coverage detected