[aisleriot] sol: Don't accept non-UTF-8 locale
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [aisleriot] sol: Don't accept non-UTF-8 locale
- Date: Sat, 19 Mar 2016 12:32:44 +0000 (UTC)
commit e2d3fa5d6ed9f8c0a4af9214e526f75622d5e641
Author: Christian Persch <chpe gnome org>
Date: Sat Mar 19 13:24:47 2016 +0100
sol: Don't accept non-UTF-8 locale
This leads to strings in guile being replaced by '?'s when
mixed with UTF-8 strings.
src/lib/ar-runtime.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/lib/ar-runtime.c b/src/lib/ar-runtime.c
index deb6edc..4242513 100644
--- a/src/lib/ar-runtime.c
+++ b/src/lib/ar-runtime.c
@@ -256,9 +256,15 @@ gboolean
ar_runtime_init (const char *name)
{
gboolean retval;
+ const char *charset;
setlocale (LC_ALL, "");
+ if (!g_get_charset (&charset)) {
+ g_printerr ("Non UTF-8 locale (%s) is not supported!\n", charset);
+ return FALSE;
+ }
+
#ifdef G_OS_WIN32
/* On Windows, when called from a console, get console output. This works
* only with Windows XP or higher; Windows 2000 will not have console
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]