The f_utf_char_t is supposed to be an uint32_t so this is not a problem.
The intent and design of this, however, is that f_utf_char_t is a special case representing the character as a string rather than as a digit.
The f_utf_char_t is stored as a 4-byte integer to store each byte representing a character.
The uint32_t is simply a straight up 4-byte integer.
This is the numeric value of the code point rather than the representation as a string.
This is an important semantic difference.
#endif // _di_f_utf_unicode_to_
#ifndef _di_f_utf_unicode_string_to_f_
- f_status_t f_utf_unicode_string_to(const f_string_t string, const f_array_length_t length, f_utf_char_t *unicode) {
+ f_status_t f_utf_unicode_string_to(const f_string_t string, const f_array_length_t length, uint32_t *unicode) {
#ifndef _di_level_0_parameter_checking_
if (!unicode) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
return F_status_set_error(F_valid_not);
}
- f_utf_char_t value = 0;
+ uint32_t value = 0;
for (; i < length; ++i) {
* F_valid_not (with error bit) if string is not a valid Unicode string.
*/
#ifndef _di_f_utf_unicode_string_to_
- extern f_status_t f_utf_unicode_string_to(const f_string_t string, const f_array_length_t length, f_utf_char_t *unicode);
+ extern f_status_t f_utf_unicode_string_to(const f_string_t string, const f_array_length_t length, uint32_t *unicode);
#endif // _di_f_utf_unicode_string_to_
#ifdef __cplusplus
} // for
if (buffer.used > 2) {
- f_utf_char_t codepoint = 0;
+ uint32_t codepoint = 0;
status = f_utf_unicode_string_to(buffer.string, buffer.used, &codepoint);
#endif // _di_utf8_print_character_invalid_
#ifndef _di_utf8_print_codepoint_
- void utf8_print_codepoint(utf8_data_t * const data, const f_utf_char_t codepoint) {
+ void utf8_print_codepoint(utf8_data_t * const data, const uint32_t codepoint) {
if (codepoint < 0x10000) {
fl_print_format("%rU+%04_U%r", data->file.stream, data->prepend, codepoint, data->append);
#endif // _di_utf8_print_error_decode_
#ifndef _di_utf8_print_error_encode_
- void utf8_print_error_encode(utf8_data_t * const data, const f_status_t status, const f_utf_char_t codepoint) {
+ void utf8_print_error_encode(utf8_data_t * const data, const f_status_t status, const uint32_t codepoint) {
if (data->main->error.verbosity == f_console_verbosity_quiet_e) return;
* This is the code that represents a single character.
*/
#ifndef _di_utf8_print_codepoint_
- extern void utf8_print_codepoint(utf8_data_t * const data, const f_utf_char_t codepoint) F_attribute_visibility_internal_d;
+ extern void utf8_print_codepoint(utf8_data_t * const data, const uint32_t codepoint) F_attribute_visibility_internal_d;
#endif // _di_utf8_print_codepoint_
/**
* The codepoint that is invalid.
*/
#ifndef _di_utf8_print_error_encode_
- extern void utf8_print_error_encode(utf8_data_t * const data, const f_status_t status, const f_utf_char_t codepoint) F_attribute_visibility_internal_d;
+ extern void utf8_print_error_encode(utf8_data_t * const data, const f_status_t status, const uint32_t codepoint) F_attribute_visibility_internal_d;
#endif // _di_utf8_print_error_encode_
/**
f_status_t status = F_none;
bool valid_not = F_false;
- f_utf_char_t codepoint = 0;
+ uint32_t codepoint = 0;
if (sequence.used) {
status = f_utf_unicode_to(sequence.string, sequence.used, &codepoint);
}
if (*mode == utf8_codepoint_mode_end_e) {
- f_utf_char_t codepoint = 0;
+ uint32_t codepoint = 0;
status = f_utf_unicode_string_to(data->text.string, data->text.used, &codepoint);