Commit 7b21f9d5 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Win32: fix gettext with non-ASCII installation path

Note that this only works if the path can be represented in the ANSI
code page. Otherwise, you will need to patch gettext.
parent af742c72
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
# include <libintl.h> # include <libintl.h>
# if defined (__APPLE__) || defined (WIN32) # if defined (__APPLE__) || defined (WIN32)
# include "config/configuration.h" # include "config/configuration.h"
# include <vlc_charset.h>
# endif # endif
#endif #endif
...@@ -41,13 +42,15 @@ int vlc_bindtextdomain (const char *domain) ...@@ -41,13 +42,15 @@ int vlc_bindtextdomain (const char *domain)
# if !defined (__APPLE__) && !defined (WIN32) # if !defined (__APPLE__) && !defined (WIN32)
static const char path[] = LOCALEDIR; static const char path[] = LOCALEDIR;
# else # else
char *datadir = config_GetDataDirDefault(); char *path = config_GetDataDirDefault();
char *path; char *buf;
if (unlikely(datadir == NULL)) if (unlikely(path == NULL))
return -1; return -1;
ret = asprintf (&path, "%s" DIR_SEP "locale", datadir); ret = asprintf (&buf, "%s" DIR_SEP "locale", path);
free (datadir); free (path);
path = ToLocaleDup (buf);
free (buf);
# endif # endif
if (bindtextdomain (domain, path) == NULL) if (bindtextdomain (domain, path) == NULL)
......
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