Lines Matching refs:bytes
43 UTF8NextCharLen(const char *bytes, size_t length)
45 if (bytes == NULL || length == 0 || bytes[0] == 0)
48 if ((bytes[0] & 0x80) == 0) {
53 if (IsInsideGlyph(bytes[0])) {
62 while ((bytes[0] & mask) != 0) {
72 // There would need to be more bytes to satisfy the char.
78 if (!IsInsideGlyph(bytes[i])) {
107 /*! UTF8CountBytes gets the length (in bytes) of a UTF8 string. Up to
112 UTF8CountBytes(const char *bytes, int32 numChars)
114 if (bytes == NULL)
120 const char *base = bytes;
121 while (bytes[0] != '\0') {
122 if ((bytes[0] & 0xc0) != 0x80) {
126 bytes++;
129 return bytes - base;
134 numBytes bytes are read. If numBytes is a negative value it is ignored
138 UTF8CountChars(const char *bytes, int32 numBytes)
140 if (bytes == NULL)
145 while (bytes[0]) {
146 if ((bytes++[0] & 0xc0) != 0x80)
150 const char *last = bytes + numBytes - 1;
151 while (bytes[0] && bytes <= last) {
152 if ((bytes++[0] & 0xc0) != 0x80)
169 UTF8ToCharCode(const char **bytes)
174 if (((*bytes)[0] & 0x80) == 0) {
176 result = (*bytes)[0];
179 (*bytes)++;
185 if (((*bytes)[0] & 0xc0) == 0x80) {
187 (*bytes)++;
193 result = (uint32)((*bytes)[0] & 0xff);
194 (*bytes)++;
206 while (((*bytes)[0] & 0xc0) == 0x80) {
208 result += (*bytes)[0] & 0x3f;
209 (*bytes)++;
219 if ((*bytes)[0] == '\0') {
224 // not enough bytes in multibyte char