JVM
|
#include "utf8.h"
Macros | |
#define | SINGLE_BYTE_MASK 0x80 |
#define | SINGLE_BYTE_VALUE 0 |
#define | DOUBLE_BYTE_MASK 0xE0 |
#define | DOUBLE_BYTE_VALUE 0xC0 |
#define | TRIPLE_BYTE_MASK 0xF0 |
#define | TRIPLE_BYTE_VALUE 0xE0 |
#define | FOLLOW_BYTE_MASK 0xC0 |
#define | FOLLOW_BYTE_VALUE 0x80 |
Functions | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
uint32_t | UTF8StringLength (const uint8_t *utf8_bytes, int32_t utf8_len) |
Returns the number of characters a UTF-8 string has. More... | |
#define DOUBLE_BYTE_MASK 0xE0 |
#define DOUBLE_BYTE_VALUE 0xC0 |
#define FOLLOW_BYTE_MASK 0xC0 |
#define FOLLOW_BYTE_VALUE 0x80 |
#define SINGLE_BYTE_MASK 0x80 |
#define SINGLE_BYTE_VALUE 0 |
#define TRIPLE_BYTE_MASK 0xF0 |
#define TRIPLE_BYTE_VALUE 0xE0 |
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.
const | uint8_t* utf8A_bytes - pointer to the bytes that make the UTF-8 A string to be compared |
const | uint8_t* utf8B_bytes - pointer to the bytes that make the UTF-8 B string to be compared |
int32_t | utf8A_len - length of the bytes that make the A string |
int32_t | utf8B_len - length of the bytes that make the B string |
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.
const | uint8_t* utf8_bytes - bytes of the UTF-8 string |
int32_t | utf8_len - length of the UTF-8 string |
const | uint8_t* ascii_bytes - ASCII string to compare to |
int32_t | ascii_len - length of ASCII string |
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.
The difference in this function is that it considers slashes (/) and backslashes () the same characters, and consecutive slashes or backslashes are treated like one character, for sake of checking if two strings are actually the path to the same file/directory. utf8A_bytes and utf8B_bytes are the pointers to the bytes that make the UTF-8 strings A and B that will be compared. utf8A_len and utf8B_len are the length of the bytes that make those strings, respectively.
const | uint8_t* utf8A_bytes - pointer to the bytes that make the UTF-8 A string to be compared |
const | uint8_t* utf8B_bytes pointer to the bytes that make the UTF-8 B string to be compared |
int32_t | utf8A_len - length of the bytes that make the A string |
int32_t | utf8B_len - length of the bytes that make the B string |
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.
const | uint8_t* utf8_bytes - represents the character being read |
int32_t | utf8_len - is the number of characteres |
uint32_t* | outCharacter - pointer where the character being read is written, if it isn't NULL |
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.
const | uint8_t* utf8_bytes - UTF-8 strem to be translate |
int32_t | utf8_len - length of the bytes that make the UTF-8 strem |
uint8_t* | out_buffer - pointer where the result will be stored |
int32_t | buffer_len - length of the bytes that make out_buffer |
uint32_t UTF8StringLength | ( | const uint8_t * | utf8_bytes, |
int32_t | utf8_len | ||
) |
Returns the number of characters a UTF-8 string has.
const | uint8_t* utf8_bytes - UTF-8 strem |
length | of the bytes that make utf8_bytes |