Commit 0970461e authored by Naohiro KORIYAMA's avatar Naohiro KORIYAMA Committed by Felix Paul Kühne

src: Fix for Mac OS X filesystem filename encoding

Signed-off-by: default avatarFelix Paul Kühne <fkuehne@videolan.org>
parent d2f181ab
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_url.h> #include <vlc_url.h>
#include <vlc_charset.h>
#include <vlc_fs.h> #include <vlc_fs.h>
#include <ctype.h> #include <ctype.h>
...@@ -170,6 +171,19 @@ char *vlc_path2uri (const char *path, const char *scheme) ...@@ -170,6 +171,19 @@ char *vlc_path2uri (const char *path, const char *scheme)
path = p; path = p;
#endif #endif
#if defined( __APPLE__ )
/* Mac OS X uses Unicode for their files and folder name with HFS+:
* Unicode Normalization Form D (NFD) (with some modification).
* But simply converting to NFC causes some problem.
* So using UTF-8-MAC, encoding for HFS+, to convert to UTF-8.
*
* Note: UTF-8-MAC is only implemented for built-in iconv on Mac OS X.
*/
char* psz_tmp_path = FromCharset("UTF-8-MAC", path, strlen(path));
strcpy((char *)path, psz_tmp_path);
free(psz_tmp_path);
#endif
#if defined( _WIN32 ) || defined( __OS2__ ) #if defined( _WIN32 ) || defined( __OS2__ )
/* Drive letter */ /* Drive letter */
if (isalpha ((unsigned char)path[0]) && (path[1] == ':')) if (isalpha ((unsigned char)path[0]) && (path[1] == ':'))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment