From: Steinar H. Gunderson Date: Sat, 19 Feb 2005 12:47:49 +0000 (+0000) Subject: Specify correct ucs-4le/ucs-4be for little/big endian. X-Git-Url: https://git.sesse.net/?p=ccbs;a=commitdiff_plain;h=6e0f1bfd93c9db392ea31e79b9ce712de3e24b27;hp=e99870759dc603bcce21a792ed30a4b227f11527 Specify correct ucs-4le/ucs-4be for little/big endian. --- diff --git a/bigscreen/ccbs_bigscreen.cpp b/bigscreen/ccbs_bigscreen.cpp index 8e09f0d..78dc4a3 100644 --- a/bigscreen/ccbs_bigscreen.cpp +++ b/bigscreen/ccbs_bigscreen.cpp @@ -6,6 +6,7 @@ #include #include FT_FREETYPE_H #include +#include iconv_t ucs4_iconv; @@ -221,7 +222,11 @@ int my_draw_text(const widestring &str, unsigned char *buf, int xpos, int ypos, int main(int argc, char **argv) { - ucs4_iconv = iconv_open("ucs-4le", "utf-8"); // FIXME: will be broken for big endian! +#if __BYTE_ORDER == __LITTLE_ENDIAN + ucs4_iconv = iconv_open("ucs-4le", "utf-8"); +#else + ucs4_iconv = iconv_open("ucs-4be", "utf-8"); +#endif ptc_open("CCBS bigscreen", 800, 600);