|
楼主 |
发表于 2005-5-2 22:39:26
|
显示全部楼层
我劝你还是把精力放在解决 timidity gtk 界面中文支持问题上吧.这是过去我编译的带有 gtk UI 的版本:
你不觉得让一个只自学了几天 C 语言的人去做这件事有点太不人道么?
现在显示正常了,但列表里的文件不能打开了…………
[code:1]--- TiMidity++-2.13.2/interface/gtk_i.c 2004-09-09 01:23:17.000000000 -0400
+++ TiMidity++-2.13.2.ed/interface/gtk_i.c 2005-05-02 22:20:00.000000000 -0400
@@ -172,7 +172,7 @@ filer_cb(GtkWidget *widget, gpointer dat
if(glob(patt, GLOB_BRACE|GLOB_NOMAGIC|GLOB_TILDE, NULL, &pglob))
return;
for( i = 0; i < pglob.gl_pathc; i++) {
- filenames[0] = pglob.gl_pathv[i];
+ filenames[0] = g_locale_to_utf8(pglob.gl_pathv[i], -1, NULL, NULL, NULL);
filenames[1] = NULL;
gtk_clist_append(GTK_CLIST(clist), filenames);
}
@@ -180,7 +180,7 @@ filer_cb(GtkWidget *widget, gpointer dat
}
#else
if((int)data == 1) {
- filenames[0] = gtk_file_selection_get_filename(GTK_FILE_SELECTION(filesel));
+ filenames[0] = g_locale_to_utf8(gtk_file_selection_get_filename(GTK_FILE_SELECTION(filesel)), -1, NULL, NULL, NULL);
filenames[1] = NULL;
gtk_clist_append(GTK_CLIST(clist), filenames);
}
@@ -282,13 +282,13 @@ playlist_op(GtkWidget *widget, guint dat
if(action == 'l') {
if((plfp = fopen(filename[0], "r")) == NULL) {
- g_error("Can't open %s for reading.", filename[0]);
+ g_error("Can't open %s for reading.", g_locale_to_utf8(filename[0], -1, NULL, NULL, NULL));
return;
}
while(fgets(fname, BUFSIZ, plfp) != NULL) {
if(fname[strlen(fname) - 1] == '\n')
fname[strlen(fname) - 1] = '\0';
- filename[0] = fname;
+ filename[0] = g_locale_to_utf8(fname, -1, NULL, NULL, NULL);
filename[1] = NULL;
gtk_clist_append(GTK_CLIST(clist), filename);
}
@@ -297,7 +297,7 @@ playlist_op(GtkWidget *widget, guint dat
}
else if(action == 's') {
if((plfp = fopen(filename[0], "w")) == NULL) {
- g_error("Can't open %s for writing.", filename[0]);
+ g_error("Can't open %s for writing.", g_locale_to_utf8(filename[0], -1, NULL, NULL, NULL));
return;
}
for(i = 0; i < GTK_CLIST(clist)->rows; i++) {
[/code:1] |
|