[MPlayer-dev-eng] [PATCH] subreader.c fix for foreign languages in subtitles
Gianluigi Tiesi
mplayer at netfarm.it
Fri Jul 28 21:25:58 CEST 2006
A guy (Junkyu Lee) pointed me to the fact that utf8 korean subtitles was
not working
(at least on windows),
the trail_space function uses isspace() to skip spaces,
isspace at least on windows expects a positive integer,
I'm working on other stuff with vs2005, and it spots an assert
if the value is negative.
mingw silently ignores it but produces bad results.
I don't have a testcase on unix, this is a small patches
that auto casts the value to unsigned (at least avoid changing
other stuffs around):
--- main/subreader.c 2006-07-28 01:16:31.843566400 +0200
+++ sherpya/subreader.c 2006-07-28 01:23:59.066641600 +0200
@@ -72,7 +72,7 @@
}
/* Remove leading and trailing space */
-static void trail_space(char *s) {
+static void trail_space(unsigned char *s) {
int i = 0;
while (isspace(s[i])) ++i;
if (i) strcpy(s, s + i);
or directly the file:
http://oss.netfarm.it/mplayer/patches/05_subreader_fix.diff
he says that this way works for him
Regards
--
Gianluigi Tiesi <sherpya at netfarm.it>
EDP Project Leader
Netfarm S.r.l. - http://www.netfarm.it/
Free Software: http://oss.netfarm.it/
More information about the MPlayer-dev-eng
mailing list