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

Ludovic Fauvet git at videolan.org
Wed Aug 28 17:55:31 CEST 2013


vlc | branch: master | Ludovic Fauvet <etix at videolan.org> | Wed Aug 28 17:27:12 2013 +0200| [3e43d99c32e4367dcd1908551c1a4f50bb2dbccd] | committer: Ludovic Fauvet

cue: support Latin1 cue files (fix #9238)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3e43d99c32e4367dcd1908551c1a4f50bb2dbccd
---

 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