[vlc-commits] cue: support Latin1 cue files (fix #9238)

Ludovic Fauvet git at videolan.org
Wed Aug 28 18:20:44 CEST 2013


vlc/vlc-2.1 | branch: master | Ludovic Fauvet <etix at videolan.org> | Wed Aug 28 17:27:12 2013 +0200| [8992a6e549f398bd6edd44e8c055025887b53d76] | committer: Jean-Baptiste Kempf

cue: support Latin1 cue files (fix #9238)

(cherry picked from commit 3e43d99c32e4367dcd1908551c1a4f50bb2dbccd)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.1.git/?a=commit;h=8992a6e549f398bd6edd44e8c055025887b53d76
---

 share/lua/playlist/cue.lua |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/share/lua/playlist/cue.lua b/share/lua/playlist/cue.lua
index 794a400..7854b9e 100644
--- a/share/lua/playlist/cue.lua
+++ b/share/lua/playlist/cue.lua
@@ -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



More information about the vlc-commits mailing list