From f8f81c934670b611d102cc5f69dfbc519f74bed1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Mon, 26 Jan 2004 09:49:33 +0000 Subject: It seems some older systems haven't UCS-2 encoding in the machine encoding. Force using UCS-2LE or UCS-2BE according to endianness. CVS patchset: 6065 CVS date: 2004/01/26 09:49:33 --- ChangeLog | 1 + src/xine-engine/osd.c | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6d22cd332..72b15623a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,7 @@ xine-lib (1-rc4) * preliminary matroska support * support for AAC audio in RealMedia files * implement chapter skipping in ogm files + * fix endianness problem in OSD texts (using UCS-2LE or UCS-2BE encoding) xine-lib (1-rc3a) * new subtitle formats: jacobsub, subviewer 2.0, subrip 0.9 diff --git a/src/xine-engine/osd.c b/src/xine-engine/osd.c index cb638128b..70213606a 100644 --- a/src/xine-engine/osd.c +++ b/src/xine-engine/osd.c @@ -74,6 +74,13 @@ */ #define ALIAS_CHARACTER_FONT '_' +/* we want UCS-2 encoding in the machine endian */ +#ifdef WORDS_BIGENDIAN +# define UCS2_ENCODING "UCS-2BE" +#else +# define UCS2_ENCODING "UCS-2LE" +#endif + #ifdef MAX #undef MAX #endif @@ -891,9 +898,9 @@ static int osd_set_encoding (osd_object_t *osd, const char *encoding) { } /* prepare conversion to UCS-2 */ - if ((osd->cd = iconv_open("UCS-2", encoding)) == (iconv_t)-1) { + if ((osd->cd = iconv_open(UCS2_ENCODING, encoding)) == (iconv_t)-1) { xprintf(osd->renderer->stream->xine, XINE_VERBOSITY_LOG, - _("osd: unsupported conversion %s -> UCS-2, no conversion performed\n"), encoding); + _("osd: unsupported conversion %s -> %s, no conversion performed\n"), encoding, UCS2_ENCODING); return 0; } -- cgit v1.2.3