]> git.sesse.net Git - ccbs/blobdiff - bigscreen/ccbs_bigscreen.cpp
Specify correct ucs-4le/ucs-4be for little/big endian.
[ccbs] / bigscreen / ccbs_bigscreen.cpp
index 8e09f0dda132d9465f4060973e928ccf302ef8a6..78dc4a382ea9e306e7a27a9fb7e69547284df7d2 100644 (file)
@@ -6,6 +6,7 @@
 #include <ft2build.h>
 #include FT_FREETYPE_H
 #include <tinyptc.h>
+#include <endian.h>
 
 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);