Commit 30f84bb8 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

Avoid using g_strescape(), since it mangles UTF-8, (#89479, Yao Zhang.)

Wed Jul 31 12:50:51 2002  Owen Taylor  <otaylor@redhat.com>

        * gtk/queryimmodules.c: Avoid using g_strescape(),
        since it mangles UTF-8, (#89479, Yao Zhang.)
parent 0a786328
Wed Jul 31 12:50:51 2002 Owen Taylor <otaylor@redhat.com>
* gtk/queryimmodules.c: Avoid using g_strescape(),
since it mangles UTF-8, (#89479, Yao Zhang.)
Tue Jul 30 19:09:46 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.c (gtk_range_scroll_event): Handle
......
Wed Jul 31 12:50:51 2002 Owen Taylor <otaylor@redhat.com>
* gtk/queryimmodules.c: Avoid using g_strescape(),
since it mangles UTF-8, (#89479, Yao Zhang.)
Tue Jul 30 19:09:46 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.c (gtk_range_scroll_event): Handle
......
Wed Jul 31 12:50:51 2002 Owen Taylor <otaylor@redhat.com>
* gtk/queryimmodules.c: Avoid using g_strescape(),
since it mangles UTF-8, (#89479, Yao Zhang.)
Tue Jul 30 19:09:46 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.c (gtk_range_scroll_event): Handle
......
Wed Jul 31 12:50:51 2002 Owen Taylor <otaylor@redhat.com>
* gtk/queryimmodules.c: Avoid using g_strescape(),
since it mangles UTF-8, (#89479, Yao Zhang.)
Tue Jul 30 19:09:46 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.c (gtk_range_scroll_event): Handle
......
Wed Jul 31 12:50:51 2002 Owen Taylor <otaylor@redhat.com>
* gtk/queryimmodules.c: Avoid using g_strescape(),
since it mangles UTF-8, (#89479, Yao Zhang.)
Tue Jul 30 19:09:46 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.c (gtk_range_scroll_event): Handle
......
Wed Jul 31 12:50:51 2002 Owen Taylor <otaylor@redhat.com>
* gtk/queryimmodules.c: Avoid using g_strescape(),
since it mangles UTF-8, (#89479, Yao Zhang.)
Tue Jul 30 19:09:46 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.c (gtk_range_scroll_event): Handle
......
......@@ -41,10 +41,38 @@
#include "gtk/gtkrc.h"
#include "gtk/gtkimmodule.h"
static char *
escape_string (const char *str)
{
GString *result = g_string_new ("");
while (TRUE)
{
char c = *str++;
switch (c)
{
case '\0':
goto done;
case '\n':
g_string_append (result, "\\n");
break;
case '\"':
g_string_append (result, "\\\"");
break;
default:
g_string_append_c (result, c);
}
}
done:
return g_string_free (result, FALSE);
}
static void
print_escaped (const char *str)
{
char *tmp = g_strescape (str, NULL);
char *tmp = escape_string (str, NULL);
printf ("\"%s\" ", tmp);
g_free (tmp);
}
......
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