JVM
utf8.h
Go to the documentation of this file.
1 #ifndef UTF8_H
2 #define UTF8_H
3 
4 #include <stdint.h>
5 
12 #define PRINT_UTF8(x) x->Utf8.length, x->Utf8.bytes
13 
20 #define UTF8(x) x->Utf8.bytes, x->Utf8.length
21 
22 uint8_t nextUTF8Character(const uint8_t* utf8_bytes, int32_t utf8_len, uint32_t* outCharacter);
23 char cmp_UTF8_Ascii(const uint8_t* utf8_bytes, int32_t utf8_len, const uint8_t* ascii_bytes, int32_t ascii_len);
24 char cmp_UTF8(const uint8_t* utf8A_bytes, int32_t utf8A_len, const uint8_t* utf8B_bytes, int32_t utf8B_len);
25 char cmp_UTF8_FilePath(const uint8_t* utf8A_bytes, int32_t utf8A_len, const uint8_t* utf8B_bytes, int32_t utf8B_len);
26 uint32_t UTF8_to_Ascii(uint8_t* out_buffer, int32_t buffer_len, const uint8_t* utf8_bytes, int32_t utf8_len);
27 uint32_t UTF8StringLength(const uint8_t* utf8_bytes, int32_t utf8_len);
28 
29 #endif // UTF8_H
30 
uint32_t UTF8StringLength(const uint8_t *utf8_bytes, int32_t utf8_len)
Returns the number of characters a UTF-8 string has.
Definition: utf8.c:262
uint32_t UTF8_to_Ascii(uint8_t *out_buffer, int32_t buffer_len, const uint8_t *utf8_bytes, int32_t utf8_len)
Function that translates a UTF-8 stream to ASCII.
Definition: utf8.c:230
char cmp_UTF8_Ascii(const uint8_t *utf8_bytes, int32_t utf8_len, const uint8_t *ascii_bytes, int32_t ascii_len)
Function to compare two strings, one in UTF-8 and other in ASCII.
Definition: utf8.c:76
char cmp_UTF8_FilePath(const uint8_t *utf8A_bytes, int32_t utf8A_len, const uint8_t *utf8B_bytes, int32_t utf8B_len)
Function to compare two strings that contains file paths, both in UTF-8.
Definition: utf8.c:144
uint8_t nextUTF8Character(const uint8_t *utf8_bytes, int32_t utf8_len, uint32_t *outCharacter)
Function to iterate over the bytes of a UTF-8.
Definition: utf8.c:24
char cmp_UTF8(const uint8_t *utf8A_bytes, int32_t utf8A_len, const uint8_t *utf8B_bytes, int32_t utf8B_len)
Function to compare two strings, both in UTF-8.
Definition: utf8.c:108