| 1178 | |
| 1179 | #if 1 |
| 1180 | txSize fxUnicodeLength(txString theString, txSize* byteLength) |
| 1181 | { |
| 1182 | txU1* p = (txU1*)theString; |
| 1183 | txU1 c; |
| 1184 | txSize unicodeLength = 0; |
| 1185 | txSize utf8Length = 0; |
| 1186 | |
| 1187 | while ((c = c_read8(p++))) { |
| 1188 | if ((c & 0xC0) != 0x80) |
| 1189 | unicodeLength++; |
| 1190 | utf8Length++; |
| 1191 | } |
| 1192 | if (byteLength) |
| 1193 | *byteLength = utf8Length; |
| 1194 | return unicodeLength; |
| 1195 | } |
| 1196 | #else |
| 1197 | // http://www.daemonology.net/blog/2008-06-05-faster-utf8-strlen.html |
| 1198 |
no outgoing calls
no test coverage detected