[vlc-commits] skins2: fix UTF8 conversion issues

Erwan Tulou git at videolan.org
Wed Jun 10 19:15:16 CEST 2015


vlc/vlc-2.2 | branch: master | Erwan Tulou <erwan10 at videolan.org> | Wed Jun 10 18:18:35 2015 +0200| [53dc47fab75cefd3a936cc9323f06b7b23b8c37c] | committer: Erwan Tulou

skins2: fix UTF8 conversion issues

The issue is twofold:
- converting filenames that are already UTF8 encoded from the Qt dialog box
- missing UTF8-to-locale conversion for filename passed as parameter to vlc

These bugs accounted for skins with name or path containing multibyte
characters not being able to load successfully on Windows.

This fixes trac #14843

(cherry picked from commit 3b6b39ac889e7a3242f7ef586c01d6821bd49d24)
Signed-off-by: Erwan Tulou <erwan10 at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=53dc47fab75cefd3a936cc9323f06b7b23b8c37c
---

 modules/gui/skins2/src/dialogs.cpp          |    4 ++--
 modules/gui/skins2/src/theme_repository.cpp |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/gui/skins2/src/dialogs.cpp b/modules/gui/skins2/src/dialogs.cpp
index 3bda3b9..9a7a55b 100644
--- a/modules/gui/skins2/src/dialogs.cpp
+++ b/modules/gui/skins2/src/dialogs.cpp
@@ -42,7 +42,7 @@ void Dialogs::showChangeSkinCB( intf_dialog_args_t *pArg )
         {
             // Create a change skin command
             CmdChangeSkin *pCmd =
-                new CmdChangeSkin( pIntf, sFromLocale( pArg->psz_results[0] ) );
+                new CmdChangeSkin( pIntf, pArg->psz_results[0] );
 
             // Push the command in the asynchronous command queue
             AsyncQueue *pQueue = AsyncQueue::instance( pIntf );
@@ -66,7 +66,7 @@ void Dialogs::showPlaylistLoadCB( intf_dialog_args_t *pArg )
     {
         // Create a Playlist Load command
         CmdPlaylistLoad *pCmd =
-            new CmdPlaylistLoad( pIntf, sFromLocale( pArg->psz_results[0] ) );
+            new CmdPlaylistLoad( pIntf, pArg->psz_results[0] );
 
         // Push the command in the asynchronous command queue
         AsyncQueue *pQueue = AsyncQueue::instance( pIntf );
diff --git a/modules/gui/skins2/src/theme_repository.cpp b/modules/gui/skins2/src/theme_repository.cpp
index 7df2283..bf19dcf 100644
--- a/modules/gui/skins2/src/theme_repository.cpp
+++ b/modules/gui/skins2/src/theme_repository.cpp
@@ -92,7 +92,7 @@ ThemeRepository::ThemeRepository( intf_thread_t *pIntf ): SkinObject( pIntf )
     free( psz_current );
 
     // check if skins exists and is readable
-    bool b_readable = !ifstream( current.c_str() ).fail();
+    bool b_readable = !ifstream( sToLocale(current).c_str() ).fail();
 
     msg_Dbg( getIntf(), "requested skins %s is %s accessible",
                          current.c_str(), b_readable ? "" : "NOT" );



More information about the vlc-commits mailing list