From 8f8d5511c56b057b0b73aec0442e990a08300618 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Mon, 26 Jan 2004 22:19:56 +0000 Subject: Force endian also in xine-fontconv (using UCS-2LE and UCS-2BE encodings). CVS patchset: 6069 CVS date: 2004/01/26 22:19:56 --- misc/xine-fontconv.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/misc/xine-fontconv.c b/misc/xine-fontconv.c index 333e50e63..5b957d862 100644 --- a/misc/xine-fontconv.c +++ b/misc/xine-fontconv.c @@ -34,6 +34,8 @@ * unicode stuff : (C) 2003 by Frantisek Dvorak */ +#include + #include #include #include @@ -50,7 +52,16 @@ #include #endif -#define MAX(a, b) ((a) > (b)? (a) : (b)) +/* we want UCS-2 encoding in the machine endian */ +#if BYTE_ORDER == BIG_ENDIAN +# define UCS2_ENCODING "UCS-2BE" +#else +# define UCS2_ENCODING "UCS-2LE" +#endif + +#ifndef MAX +# define MAX (a, b) ((a) > (b)? (a) : (b)) +#endif #define f266ToInt(x) (((x)+32)>>6) /* round fractional fixed point */ /* coordinates are in 26.6 pixels (i.e. 1/64th of pixels)*/ @@ -173,7 +184,7 @@ uint16_t generate_unicodes_list(item_t **list, char **pages, int number) { /* process all given codepages */ for (page = 0; page < number; page++) { /* prepare encoding */ - if ((cd = iconv_open("UCS-2", pages[page])) == (iconv_t)-1) { + if ((cd = iconv_open(UCS2_ENCODING, pages[page])) == (iconv_t)-1) { printf("Unsupported encoding \"%s\"\n", pages[page]); continue; } -- cgit v1.2.3