c45fbb99c9
includes lots of bug fixes and new features ok Tobias Ulmer (MAINTAINER)
31 lines
904 B
Plaintext
31 lines
904 B
Plaintext
$OpenBSD: patch-src_support_c,v 1.2 2007/09/19 19:15:13 jasper Exp $
|
|
--- src/support.c.orig Wed Sep 19 19:27:39 2007
|
|
+++ src/support.c Wed Sep 19 19:37:42 2007
|
|
@@ -168,6 +168,7 @@ utf8_to_locale(char *utf8str)
|
|
gchar *str;
|
|
gsize rb, wb;
|
|
GError *error;
|
|
+ const char *charset;
|
|
|
|
if( noconvert )
|
|
return g_strdup(utf8str);
|
|
@@ -175,15 +176,11 @@ utf8_to_locale(char *utf8str)
|
|
rb = 0; /* bytes read */
|
|
wb = 0; /* bytes written */
|
|
error = NULL;
|
|
- str=g_locale_from_utf8(utf8str,
|
|
- strlen(utf8str),
|
|
- &wb, &rb,
|
|
- &error);
|
|
+ g_get_charset(&charset);
|
|
+ str = g_convert_with_fallback(
|
|
+ utf8str, -1, charset, "UTF-8", "?", &rb, &wb, &error);
|
|
if( error )
|
|
{
|
|
- const char *charset;
|
|
-
|
|
- g_get_charset(&charset);
|
|
screen_status_printf(_("Error: Unable to convert characters to %s"),
|
|
charset);
|
|
D("utf8_to_locale(): %s\n", error->message);
|