Index: src/OFString.h ================================================================== --- src/OFString.h +++ src/OFString.h @@ -13,19 +13,21 @@ #include #import "OFObject.h" #import "OFArray.h" +typedef uint32_t of_unichar_t; + enum of_string_encoding { OF_STRING_ENCODING_UTF_8, OF_STRING_ENCODING_ISO_8859_1, OF_STRING_ENCODING_ISO_8859_15, OF_STRING_ENCODING_WINDOWS_1252 }; extern int of_string_check_utf8(const char*, size_t); -extern size_t of_string_unicode_to_utf8(uint32_t, char*); +extern size_t of_string_unicode_to_utf8(of_unichar_t, char*); extern size_t of_string_position_to_index(const char*, size_t); extern size_t of_string_index_to_position(const char*, size_t, size_t); /** * A class for managing strings. Index: src/OFString.m ================================================================== --- src/OFString.m +++ src/OFString.m @@ -108,11 +108,11 @@ return utf8; } size_t -of_string_unicode_to_utf8(uint32_t c, char *buf) +of_string_unicode_to_utf8(of_unichar_t c, char *buf) { size_t i = 0; if (c < 0x80) { buf[i] = c; @@ -297,11 +297,11 @@ for (i = j = 0; i < len; i++) { if ((uint8_t)str[i] < 0x80) string[j++] = str[i]; else { char buf[4]; - uint32_t chr; + of_unichar_t chr; size_t chr_bytes; switch (encoding) { case OF_STRING_ENCODING_ISO_8859_1: chr = (uint8_t)str[i]; Index: src/OFXMLParser.m ================================================================== --- src/OFXMLParser.m +++ src/OFXMLParser.m @@ -30,11 +30,11 @@ } static OF_INLINE OFString* parse_numeric_entity(const char *entity, size_t length) { - uint32_t c; + of_unichar_t c; size_t i; char buf[5]; if (length == 1 || *entity != '#') return nil;