diff options
author | František Dvořák <valtri@users.sourceforge.net> | 2004-01-26 22:19:56 +0000 |
---|---|---|
committer | František Dvořák <valtri@users.sourceforge.net> | 2004-01-26 22:19:56 +0000 |
commit | 8f8d5511c56b057b0b73aec0442e990a08300618 (patch) | |
tree | 06173f433ea7eb7f19176430eb2f9a5e51a1b041 | |
parent | 6c8e0f1d2fb74bd798dd787ca89711c5d5dbf570 (diff) | |
download | xine-lib-8f8d5511c56b057b0b73aec0442e990a08300618.tar.gz xine-lib-8f8d5511c56b057b0b73aec0442e990a08300618.tar.bz2 |
Force endian also in xine-fontconv (using UCS-2LE and UCS-2BE encodings).
CVS patchset: 6069
CVS date: 2004/01/26 22:19:56
-rw-r--r-- | misc/xine-fontconv.c | 15 |
1 files 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 <sys/param.h> + #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -50,7 +52,16 @@ #include <freetype/ftglyph.h> #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; } |