Merge pull request #410 from metalefty/fix-utf8-clipboard
Fix clipboard when text/filename contains non-ASCII characters
This commit is contained in:
commit
e28f529a94
@ -136,7 +136,21 @@ g_init(const char *app_name)
|
|||||||
|
|
||||||
WSAStartup(2, &wsadata);
|
WSAStartup(2, &wsadata);
|
||||||
#endif
|
#endif
|
||||||
setlocale(LC_CTYPE, "");
|
|
||||||
|
/* In order to get g_mbstowcs and g_wcstombs to work properly with
|
||||||
|
UTF-8 non-ASCII characters, LC_CTYPE cannot be "C" or blank.
|
||||||
|
To select UTF-8 encoding without specifying any countries/languages,
|
||||||
|
"C.UTF-8" is used but provided in few systems.
|
||||||
|
|
||||||
|
See also: https://sourceware.org/glibc/wiki/Proposals/C.UTF-8 */
|
||||||
|
char *lc_ctype;
|
||||||
|
lc_ctype = setlocale(LC_CTYPE, "C.UTF-8");
|
||||||
|
if (lc_ctype == NULL)
|
||||||
|
{
|
||||||
|
/* use en_US.UTF-8 instead if not available */
|
||||||
|
setlocale(LC_CTYPE, "en_US.UTF-8");
|
||||||
|
}
|
||||||
|
|
||||||
g_mk_temp_dir(app_name);
|
g_mk_temp_dir(app_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user