[gnome-mud] A patch about international
- From: Falls Huang <bhuang qubit-star com>
- To: gnome-mud-list gnome org
- Subject: [gnome-mud] A patch about international
- Date: Tue, 28 Dec 2004 15:26:16 +0800
Hello!
I'm a mud player from China. The mud of China is encoded in charset of
"GBK" , and the gnome-mud couldn't execute the trigger checking in my
debian-box.
I viewed the source of gnome-mud and found a bug. The attach is my
patch, I hope it will be useful to anyone need it .
Regards
Falls Huang
--- /tmp/data.c 2004-12-28 15:11:29.000000000 +0800
+++ gnome-mud-0.10.5/src/data.c 2003-12-13 03:44:31.000000000 +0800
@@ -114,40 +114,16 @@
gchar *check_actions (GList *list, gchar *incoming)
{
GList *entry;
- gchar *str ;
- static gboolean c_a_flag = FALSE;
- static gchar *mud_charset;
- gboolean need_convert = FALSE;
-
- if ( FALSE == c_a_flag ) {
- c_a_flag = TRUE;
- if ( FALSE == g_get_charset(&mud_charset) )
- fprintf(stdout, "mud charset:%s\n",mud_charset);
- else
- fprintf(stdout, "mud charset is utf8(%s)\n",mud_charset);
- }
-
- if ( 0 != strcasecmp("UTF-8",mud_charset) )
- need_convert = TRUE;
+ gchar *str;
for (entry = g_list_first(list); entry != NULL; entry = g_list_next(entry))
{
str = ((gchar **) entry->data)[0];
- if ( need_convert )
- {
- str = g_convert( str, strlen(str) , mud_charset , "UTF-8" , 0 , 0 , 0);
- if ( NULL == str )
- return NULL;
- }
if (match_line(str, incoming))
{
- if ( need_convert )
- g_free(str);
return ((gchar **) entry->data)[1];
}
- if ( need_convert )
- g_free(str);
}
return NULL;
[
Date Prev][Date Next] [
Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]