[easytag/wip/future-gtk: 30/31] Use g_str_to_ascii() for displaying filenames
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [easytag/wip/future-gtk: 30/31] Use g_str_to_ascii() for displaying filenames
- Date: Tue, 26 Jan 2016 10:28:14 +0000 (UTC)
commit e8daf8ffc8db0451bcdf1dbe06f13cdd49b5d776
Author: David King <amigadave amigadave com>
Date: Fri Jan 15 18:41:16 2016 +0000
Use g_str_to_ascii() for displaying filenames
Rather than calling iconv() with the extra "//IGNORE" option, call
g_str_to_ascii() with the current locale.
configure.ac | 4 ++--
src/charset.c | 20 +-------------------
2 files changed, 3 insertions(+), 21 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index f925942..b83338e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -334,9 +334,9 @@ AS_IF([test "x$have_libnautilus_extension" = "xno"],
AM_CONDITIONAL([ENABLE_NAUTILUS_ACTIONS], [test x"$have_libnautilus_extension" != x"no"])
dnl Check the pkg-config dependencies
-GIO_DEPS="gio-2.0 >= 2.38.0"
+GIO_DEPS="gio-2.0 >= 2.40.0"
AC_SUBST([GLIB_DEPRECATION_FLAGS],
- ["-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_38 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_38"])
+ ["-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_40 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_40"])
GTK_DEPS="gtk+-3.0 >= 3.14.0"
AC_SUBST([GTK_DEPRECATION_FLAGS],
["-DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_14 -DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_14"])
diff --git a/src/charset.c b/src/charset.c
index 643c028..2a35bd8 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -504,25 +504,7 @@ filename_from_display (const gchar *string)
break;
case ET_RENAME_ENCODING_TRANSLITERATE:
{
- /* iconv_open (3):
- * When the string "//TRANSLIT" is appended to tocode,
- * transliteration is activated. This means that when a
- * character cannot be represented in the target character set,
- * it can be approximated through one or several similarly
- * looking characters.
- */
- /* TODO: Use g_str_to_ascii() in GLib 2.40. */
- gchar *enc = g_strconcat (*filename_encodings, "//TRANSLIT", NULL);
- ret = g_convert (string, -1, enc, "UTF-8", NULL, NULL, &error);
-
- if (!ret)
- {
- g_debug ("Error while converting filename from display to transliterated encoding '%s':
%s",
- enc, error->message);
- g_clear_error (&error);
- }
-
- g_free (enc);
+ ret = g_str_to_ascii (string, NULL);
break;
}
case ET_RENAME_ENCODING_IGNORE:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]