Name
getnextchar -- get next Unicode character from string (V7.0)
Synopsis
int ch = getnextchar(const char *s, int *idx);
Function
Reads the next Unicode character from s from the byte offset pointed to by idx. Upon return, the integer pointed to by idx is increased by the number of bytes read. In UTF-8, this can be up to 4 bytes per character. s must be a valid UTF-8 string.

This function can be used to easily read all individual Unicode characters from a UTF-8 string like so:

 
int i = 0;
while(s[i]) {
    printf("Got character: %d\n", getnextchar(s, &i));
}

Designer compatibility
Unsupported

Inputs
s
input string
idx
pointer to an integer containing the byte offset that defines where to start reading
Results
ch
Unicode character read from string

Show TOC