# HG changeset patch # User masneyb # Date 1096855653 0 # Node ID 5dc685bf403e1dc9f9d1f61c125b7c4ec6c3db81 # Parent 6451504bed0b8f447c770ace3291b911b4d8a752 2004-10-3 Brian Masney * lib/protocols.c (gftp_string_to_utf8) - if the current string is already in UTF-8, always return NULL, even if the iconv module is initialized for this session. If there is an error converting the non-UTF8 string to the current locale, then display a message to the user diff -r 6451504bed0b -r 5dc685bf403e ChangeLog --- a/ChangeLog Sat Oct 02 12:59:49 2004 +0000 +++ b/ChangeLog Mon Oct 04 02:07:33 2004 +0000 @@ -1,3 +1,10 @@ +2004-10-3 Brian Masney + * lib/protocols.c (gftp_string_to_utf8) - if the current string is + already in UTF-8, always return NULL, even if the iconv module is + initialized for this session. If there is an error converting the + non-UTF8 string to the current locale, then display a message to the + user + 2004-10-2 Brian Masney * lib/protocols.c (gftp_parse_bookmark) - convert the local and remote directories from UTF8 to the current locale specified in the @@ -2916,7 +2923,7 @@ * cvsclean - added this script - * *.[ch] - added $Id: ChangeLog,v 1.339 2004/10/02 12:59:49 masneyb Exp $ tags + * *.[ch] - added $Id: ChangeLog,v 1.340 2004/10/04 02:07:33 masneyb Exp $ tags * debian/* - updated files from Debian maintainer diff -r 6451504bed0b -r 5dc685bf403e lib/protocols.c --- a/lib/protocols.c Sat Oct 02 12:59:49 2004 +0000 +++ b/lib/protocols.c Mon Oct 04 02:07:33 2004 +0000 @@ -448,11 +448,11 @@ if (request == NULL) return (NULL); - if (request->iconv_initialized) + if (g_utf8_validate (str, -1, NULL)) + return (NULL); + else if (request->iconv_initialized) return (g_convert_with_iconv (str, -1, request->iconv, &bread, &bwrite, &error)); - else if (g_utf8_validate (str, -1, NULL)) - return (NULL); gftp_lookup_request_option (request, "remote_charsets", &tempstr); if (*tempstr == '\0') @@ -461,6 +461,10 @@ if ((ret = g_locale_to_utf8 (str, -1, &bread, &bwrite, &error)) != NULL) return (ret); + /* Don't use request->logging_function since the strings must be in UTF-8 + for the GTK+ 2.x port */ + printf (_("Error converting string '%s' to UTF-8 from current locale: %s\n"), + str, error->message); return (NULL); } @@ -514,6 +518,10 @@ if ((ret = g_locale_from_utf8 (str, -1, &bread, &bwrite, &error)) != NULL) return (ret); + /* Don't use request->logging_function since the strings must be in UTF-8 + for the GTK+ 2.x port */ + printf (_("Error converting string '%s' to current locale from UTF-8: %s\n"), + str, error->message); return (NULL); }