[vlc-commits] macosx: fixed Reveal-in-Finder for eastern european umlauts and probably other characters without a ISO-Latin fallback (close #7631)

Felix Paul Kühne git at videolan.org
Mon Oct 22 20:05:32 CEST 2012


vlc/vlc-2.0 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Mon Oct 22 19:47:52 2012 +0200| [54de66b5771226ada3133886c06e085a5c4ec169] | committer: Felix Paul Kühne

macosx: fixed Reveal-in-Finder for eastern european umlauts and probably other characters without a ISO-Latin fallback (close #7631)
(cherry picked from commit bd544fff4fa8186436a2792aed375d08a82f635f)

Conflicts:
	modules/gui/macosx/playlist.m

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=54de66b5771226ada3133886c06e085a5c4ec169
---

 NEWS                          |    3 +++
 modules/gui/macosx/playlist.m |   12 +++++++-----
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/NEWS b/NEWS
index d8c4ecd..e5872d2 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,9 @@
 Changes between 2.0.4 and 2.0.5:
 --------------------------------
 
+Mac OS X:
+ * Fix Reveal-in-Finder for files with non-Western file names
+
 
 Changes between 2.0.3 and 2.0.4:
 --------------------------------
diff --git a/modules/gui/macosx/playlist.m b/modules/gui/macosx/playlist.m
index db07adb..9794764 100644
--- a/modules/gui/macosx/playlist.m
+++ b/modules/gui/macosx/playlist.m
@@ -826,16 +826,18 @@
         if(! p_item || !p_item->p_input )
             continue;
 
-        o_mrl = [[NSMutableString alloc] initWithFormat: @"%s", decode_URI( input_item_GetURI( p_item->p_input ))];
+        char * psz_url = decode_URI(input_item_GetURI(p_item->p_input));
+        o_mrl = [[NSMutableString alloc] initWithString: [NSString stringWithUTF8String: psz_url ? psz_url : ""]];
+        if (psz_url != NULL)
+            free( psz_url );
 
         /* perform some checks whether it is a file and if it is local at all... */
-        if ([o_mrl length] > 0)
-        {
+        if ([o_mrl length] > 0) {
             NSRange prefix_range = [o_mrl rangeOfString: @"file:"];
-            if( prefix_range.location != NSNotFound )
+            if (prefix_range.location != NSNotFound)
                 [o_mrl deleteCharactersInRange: prefix_range];
 
-            if( [o_mrl characterAtIndex:0] == '/' )
+            if ([o_mrl characterAtIndex:0] == '/')
                 [[NSWorkspace sharedWorkspace] selectFile: o_mrl inFileViewerRootedAtPath: o_mrl];
         }
 



More information about the vlc-commits mailing list