chiark / gitweb /
test: utf8 - fix utf16 tests on BE machines
authorTom Gundersen <teg@jklm.no>
Wed, 18 Feb 2015 13:33:50 +0000 (14:33 +0100)
committerTom Gundersen <teg@jklm.no>
Wed, 18 Feb 2015 14:23:23 +0000 (15:23 +0100)
src/test/test-utf8.c

index befa38575413be679cad5e2ec151e911a2549810..346f8524c620c4fbdda4337b8db4489cbab15d00 100644 (file)
@@ -95,7 +95,7 @@ static void test_utf8_escaping_printable(void) {
 
 static void test_utf16_to_utf8(void) {
         char *a = NULL;
-        const uint16_t utf16[] = { 'a', 0xd800, 'b', 0xdc00, 'c', 0xd801, 0xdc37 };
+        const uint16_t utf16[] = { htole16('a'), htole16(0xd800), htole16('b'), htole16(0xdc00), htole16('c'), htole16(0xd801), htole16(0xdc37) };
         const char utf8[] = { 'a', 'b', 'c', 0xf0, 0x90, 0x90, 0xb7, 0 };
 
         a = utf16_to_utf8(utf16, 14);