Loading...
Searching...
No Matches
utf8.h File Reference

CYAML functions for handling utf8 text. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Functions

unsigned | cyaml_utf8_get_codepoint (const uint8_t *s, unsigned *len)
int | cyaml_utf8_casecmp (const void *const str1, const void *const str2)

## Detailed Description

CYAML functions for handling utf8 text.

## Function Documentation

## cyaml_utf8_casecmp()

int cyaml_utf8_casecmp | ( | const void *const | str1,
|  | const void *const | str2 )

Case insensitive comparason.

Note
  This has some limitations and only performs case insensitive comparason over some sectons of unicode.

Parameters

  [in] | str1 | First string to be compared.
  [in] | str2 | Second string to be compared.

Returns
  0 if and only if strings are equal.

## cyaml_utf8_get_codepoint()

unsigned cyaml_utf8_get_codepoint | ( | const uint8_t * | s,
|  | unsigned * | len )

Get a codepoint from the input string.

Caller must provide the expected length given the first input byte.

If a multi-byte character contains an invalid continuation byte, the character length will be updated on exit to the number of bytes consumed, and the replacement character, U+FFFD will be returned.

Parameters

  [in] | s | String to read first codepoint from.
  [in,out] | len | Expected length of first character, updated on exit.

Returns
  The codepoint or 0xfffd if character is invalid.