[MPlayer-dev-eng] [PATCH] Subtitle: UTF8 Subtitle file name matching

zhou xin soul916 at gmail.com
Mon Oct 26 09:35:01 CET 2009


Hi,

Attached patch fixing UTF8 file name matching, I tested with my subtitle
files use Chinese characters file name, It works well.

--- mplayer/subreader.c 2009-05-24 16:40:57.115699270 +0800
+++ mplayer-build/subreader.c   2009-10-16 20:04:17.498971865 +0800
@@ -1725,18 +1725,18 @@
 static void strcpy_trim(char *d, char *s)
 {
     // skip leading whitespace
-    while (*s && !isalnum(*s)) {
+    while (*s && isblank(*s)) {
        s++;
     }
     for (;;) {
        // copy word
-       while (*s && isalnum(*s)) {
+       while (*s && !isblank(*s)) {
            *d = tolower(*s);
            s++; d++;
        }
        if (*s == 0) break;
        // trim excess whitespace
-       while (*s && !isalnum(*s)) {
+       while (*s && isblank(*s)) {
            s++;
        }
        if (*s == 0) break;



More information about the MPlayer-dev-eng mailing list