Anonymous user
String Character Length: Difference between revisions
→[[Forth]]: "binary" not standard
(LSE64) |
(→[[Forth]]: "binary" not standard) |
||
Line 180:
The following code will count the number of UTF-8 characters in a null-terminated string. It relies on the fact that all bytes of a UTF-8 character except the first have the the binary bit pattern "10xxxxxx".
2 base !
: utf8+ ( str -- str )
begin
|