MCPcopy Create free account
hub / github.com/IoLanguage/io / UArray_isMultibyte

Function UArray_isMultibyte

libs/basekit/source/UArray_utf.c:117–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115}
116
117int 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
131int UArray_isLegalUTF8(const UArray *self) {
132 void *sourceStart = self->data;

Callers

nothing calls this directly

Calls 3

UArray_sizeInBytesFunction · 0.85
UArray_bytesFunction · 0.85
UArray_SizeOfUTF8CharFunction · 0.85

Tested by

no test coverage detected