Ticket #2325: 0001-HACK-sub-Partially-support-non-ASCII-external-subs-o.patch

File 0001-HACK-sub-Partially-support-non-ASCII-external-subs-o.patch, 1.0 KB (added by beastd, 9 years ago)
  • sub/subreader.c

    From 5d1c76647c795f485288fe91f3f365c66b854034 Mon Sep 17 00:00:00 2001
    From: Alexander Strasser <eclipse7@gmx.net>
    Date: Sun, 7 May 2017 23:03:56 +0200
    Subject: [PATCH] HACK: sub: Partially support non-ASCII external subs on
     Windows
    
    * Will only work for external subtitle file names in your local code page
    * Works only with the one-liner because stream_file on windows falls back
      to _sopen (otherwise we would have to re-code the directory entry's name)
    ---
     sub/subreader.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/sub/subreader.c b/sub/subreader.c
    index d57856b..a3f8fbe 100644
    a b static void append_dir_subtitles(struct sub_list *slist, const char *path,  
    19901990    len = (strlen(fname) > 256 ? strlen(fname) : 256)
    19911991         + (strlen(path) > 256 ? strlen(path) : 256) + 2;
    19921992
    1993     f_fname       = strdup(mp_basename(fname));
     1993    f_fname       = utf8_to_local_windows_code_page(mp_basename(fname));
    19941994    f_fname_noext = malloc(len);
    19951995    f_fname_trim  = malloc(len);
    19961996