VgaGames4

VgaGames4 - miscellaneous man-pages

[.. upper level ..]

# vg4->misc->utf8_tolower()

Convert UTF8-character to lowercase.

SYNTAX
int vg4->misc->utf8_tolower(int codept)
FUNCTION PARAMETERS

codept | Unicode-codepoint

RETURN VALUE
Returns lowercase-character or unchanged character
DESCRIPTION
Convert UTF8-character to lowercase.
EXAMPLE

    int codept;
    char cbuf[8];
    int no_bytes;

    /* set UTF8-character into cbuf */
    strcpy(cbuf, "Ö");

    /* get unicode-codepoint */
    no_bytes = vg4->misc->utf8_next(cbuf, strlen(cbuf), &codept);
    if (no_bytes <= 0) { exit(1); }
    printf("UTF8-character(%d)=%s\n", codept, cbuf);

    /* convert to lowercase */
    codept = vg4->misc->utf8_tolower(codept);
    no_bytes = vg4->misc->utf8_from_codepoint(codept, cbuf);
    cbuf[no_bytes] = '\0';
    printf("Lowercase UTF8-character(%d)=%s\n", codept, cbuf);

    Output:
    UTF8-character(214)=Ö
    Lowercase UTF8-character(246)=ö

SEE ALSO
vg4->misc->utf8_toupper()