diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2014-10-18 19:11:30 +0200 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2014-10-18 19:11:44 +0200 |
commit | 5ca6b7fb4258af6dcfe3741522c47054916b5529 (patch) | |
tree | 0386a3cd18160862e54c502999df90d4bae77bb3 | |
parent | d9b20f7586ac28fee0c62e34b1dad8e01ffb45c7 (diff) | |
download | termo-5ca6b7fb4258af6dcfe3741522c47054916b5529.tar.gz termo-5ca6b7fb4258af6dcfe3741522c47054916b5529.tar.xz termo-5ca6b7fb4258af6dcfe3741522c47054916b5529.zip |
Don't bother with endianity
I hope this is correct... works for little endian (which is the odd one here).
-rw-r--r-- | termo.c | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -322,13 +322,9 @@ termo_init (termo_t *tk, const char *term, const char *encoding) if (!encoding) encoding = nl_langinfo (CODESET); - static const uint16_t endianity = 0x0102; - const char *utf32 = (*(uint8_t *) &endianity == 0x01) - ? "UTF-32BE" : "UTF-32LE"; - - if ((tk->to_utf32_conv = iconv_open (utf32, encoding)) == (iconv_t) -1) + if ((tk->to_utf32_conv = iconv_open ("UTF-32", encoding)) == (iconv_t) -1) return 0; - if ((tk->from_utf32_conv = iconv_open (encoding, utf32)) == (iconv_t) -1) + if ((tk->from_utf32_conv = iconv_open (encoding, "UTF-32")) == (iconv_t) -1) goto abort_free_to_utf32; tk->buffer = malloc (tk->buffsize); |