cue: support Latin1 cue files (fix #9238)
authorLudovic Fauvet <etix@videolan.org>
Wed, 28 Aug 2013 15:27:12 +0000 (17:27 +0200)
committerLudovic Fauvet <etix@videolan.org>
Wed, 28 Aug 2013 15:46:58 +0000 (17:46 +0200)
share/lua/playlist/cue.lua

index 794a400..7854b9e 100644 (file)
@@ -31,7 +31,15 @@ function probe()
 end
 
 -- Helpers
+function is_utf8( src )
+    return vlc.strings.from_charset( "UTF-8", src ) == src
+end
+
 function cue_string( src )
+       if not is_utf8( src ) then
+               -- Convert to UTF-8 since it's probably Latin1
+               src = vlc.strings.from_charset( "ISO_8859-1", src )
+       end
        local sub = string.match( src, "^\"(.*)\".*$" );
        if( sub ) then
                return sub