Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 43121
Collapse All | Expand All

(-)emelfm2-0.0.8/src/dialogs/e2_mkdir_dialog.c (-3 / +3 lines)
Lines 74-80 static gchar *find_dir (const gchar *dir Link Here
74
	if (dir == NULL)
74
	if (dir == NULL)
75
		dir = _("new directory");
75
		dir = _("new directory");
76
	//the absolute directory name consists of 4 parts
76
	//the absolute directory name consists of 4 parts
77
	gchar *str = _UTF2STR (dir);
77
	gchar *str = _UTF2STR ((gchar*)dir);
78
	//parent directory in case the entered string is not absolute
78
	//parent directory in case the entered string is not absolute
79
	gchar *part1 = g_path_is_absolute (str) ?
79
	gchar *part1 = g_path_is_absolute (str) ?
80
		g_strdup ("") : _UTF2STR (rt->path);
80
		g_strdup ("") : _UTF2STR (rt->path);
Lines 259-265 static void update_labels (E2_MkdirDialo Link Here
259
	const gchar *dir = gtk_entry_get_text (GTK_ENTRY
259
	const gchar *dir = gtk_entry_get_text (GTK_ENTRY
260
		(GTK_BIN (rt->combo)->child));
260
		(GTK_BIN (rt->combo)->child));
261
261
262
	gchar *path = _UTF2STR (dir);
262
	gchar *path = _UTF2STR ((gchar*)dir);
263
263
264
	gchar *reason = NULL;
264
	gchar *reason = NULL;
265
	rt->creation_possible = TRUE;
265
	rt->creation_possible = TRUE;
Lines 384-390 static void create_dir (GtkWidget *entry Link Here
384
	if (*dir == '\0')
384
	if (*dir == '\0')
385
		return;
385
		return;
386
	
386
	
387
	gchar *path = _UTF2STR (dir);
387
	gchar *path = _UTF2STR ((gchar*)dir);
388
	if (!g_path_is_absolute (path))
388
	if (!g_path_is_absolute (path))
389
	{
389
	{
390
		gchar *free = path;
390
		gchar *free = path;
(-)emelfm2-0.0.8/src/e2_main.c (-10 / +8 lines)
Lines 168-186 static void check_locale () Link Here
168
{
168
{
169
	printd (DEBUG, "check_locale ()");
169
	printd (DEBUG, "check_locale ()");
170
	gchar *locale = gtk_set_locale ();
170
	gchar *locale = gtk_set_locale ();
171
	printd (NOTICE, "current locale is '%s'", locale);
171
	printf ("current locale is '%s'\n", locale);
172
172
	const gchar *broken =  g_getenv ("G_BROKEN_FILENAMES");
173
	const gchar *broken =  g_getenv ("G_BROKEN_FILENAMES");
173
	if (broken != NULL && STREQ (locale, "C"))
174
	if (broken != NULL && STREQ (locale, "C"))
174
	{
175
	{
175
		printd (ERROR, "cannot convert broken filenames with 'C' locale");
176
		printf("You have set the environment variable G_BROKEN_FILENAMES. GTK+ is\n"
176
		printf 
177
			   "supposed to now treat filenames if they are in the system locale.\n"
177
		(_(
178
			   "However, you have not set a system locale. We will default to ISO-8859-1\n"
178
			"\nThe error above usually means that you've set the environment variable\n"
179
			   "when reading filenames. If this produces odd behaviour when handling filenames\n"
179
			"G_BROKEN_FILENAMES to something. Then GTK+2 is suppossed to work with file names\n"
180
			   "with non-ASCII characters in them, then please set a system locale with the LANG\n"
180
			"in your locale. Though, it is impossible to do this without a known locale.\n"
181
			   "environment variable\n.");
181
			"To prevent crashes please either unset G_BROKEN_FILENAMES or adjust your locale.\n\n"
182
		));
183
		exit (1);
184
	}
182
	}
185
	
183
	
186
#ifdef ENABLE_NLS
184
#ifdef ENABLE_NLS
(-)emelfm2-0.0.8/src/emelfm2.h (-4 / +55 lines)
Lines 68-77 Link Here
68
#define MAX_COLUMNS 8
68
#define MAX_COLUMNS 8
69
69
70
#define STREQ(a,b) (g_str_equal ((a),(b)))
70
#define STREQ(a,b) (g_str_equal ((a),(b)))
71
#define _STR2UTF(d) g_filename_to_utf8 (d, -1, NULL, NULL, NULL)
71
72
#define _UTF2STR(d) g_filename_from_utf8 (d, -1, NULL, NULL, NULL)
72
static inline gchar *_STR2UTF(gchar *d) {	  
73
#define STR2UTF(d) g_locale_to_utf8 (d, -1, NULL, NULL, NULL)
73
	gchar *ret;
74
#define UTF2STR(d) g_locale_from_utf8 (d, -1, NULL, NULL, NULL)
74
	ret = g_filename_to_utf8(d, -1, NULL, NULL, NULL);
75
	if(!ret) {
76
		ret = g_convert(d, -1, "utf-8", "iso-8859-1",
77
						NULL, NULL, NULL);
78
		if(!ret)
79
			ret = g_strdup("Unknown");
80
	}
81
	return ret;
82
}
83
84
static inline gchar *_UTF2STR(gchar *d) {	  
85
	gchar *ret;
86
	ret = g_filename_from_utf8(d, -1, NULL, NULL, NULL);
87
	if(!ret) {
88
		ret = g_convert(d, -1, "iso-8859-1", "utf-8",
89
						NULL, NULL, NULL);
90
		if(!ret)
91
			ret = g_strdup("Unknown");
92
	}
93
	return ret;
94
}
95
96
static inline gchar *STR2UTF(gchar *d) {
97
	gchar *ret;
98
	if (g_utf8_validate(d, -1, NULL))
99
		return g_strdup(d);
100
101
	ret = g_locale_to_utf8(d, -1, NULL, NULL, NULL);
102
103
	if (!ret)
104
		ret = g_convert(d, -1, "utf-8", "iso-8859-1", NULL, NULL, NULL);
105
106
	if (!ret)
107
		ret = g_strdup("Unknown");
108
109
	return ret;
110
}
111
112
113
static inline gchar *UTF2STR(gchar *d) {
114
	gchar *ret;
115
	ret = g_locale_from_utf8(d, -1, NULL, NULL, NULL);
116
117
	if (!ret)
118
		ret = g_convert(d, -1, "iso-8859-1", "utf-8", NULL, NULL, NULL);
119
120
	if (!ret)
121
		ret = g_strdup("Unknown");
122
123
	return ret;
124
}
125
75
#define MESC(d) g_markup_escape_text (d, -1)
126
#define MESC(d) g_markup_escape_text (d, -1)
76
#define WAIT_FOR_EVENTS while (gtk_events_pending ()) { gtk_main_iteration (); }
127
#define WAIT_FOR_EVENTS while (gtk_events_pending ()) { gtk_main_iteration (); }
77
128

Return to bug 43121