Mercurial > gftp.yaz
changeset 46:3da7765bc439
2002-10-31 Brian Masney <masneyb@gftp.org>
* lib/protocols.c (gftp_get_next_file) - don't use g_filename_to_utf8.
If g_locale_to_utf8 fails, print out a warning to the user on the
console
author | masneyb |
---|---|
date | Fri, 01 Nov 2002 00:10:08 +0000 |
parents | 311e29c40ed6 |
children | eec25f215772 |
files | ChangeLog lib/protocols.c |
diffstat | 2 files changed, 12 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Thu Oct 31 23:55:17 2002 +0000 +++ b/ChangeLog Fri Nov 01 00:10:08 2002 +0000 @@ -1,3 +1,8 @@ +2002-10-31 Brian Masney <masneyb@gftp.org> + * lib/protocols.c (gftp_get_next_file) - don't use g_filename_to_utf8. + If g_locale_to_utf8 fails, print out a warning to the user on the + console + 2002-10-31 Brian Masney <masneyb@gftp.org> * src/gtk/*.[ch] - don't check for gtk+ version based on the minor version. May cause problems later on. @@ -122,7 +127,7 @@ * cvsclean - added this script - * *.[ch] - added $Id: ChangeLog,v 1.24 2002/10/31 23:55:15 masneyb Exp $ tags + * *.[ch] - added $Id: ChangeLog,v 1.25 2002/11/01 00:10:08 masneyb Exp $ tags * debian/* - updated files from Debian maintainer
--- a/lib/protocols.c Thu Oct 31 23:55:17 2002 +0000 +++ b/lib/protocols.c Fri Nov 01 00:10:08 2002 +0000 @@ -462,6 +462,7 @@ #if GLIB_MAJOR_VERSION > 1 gsize bread, bwrite; char *tempstr; + GError * error; #endif g_return_val_if_fail (request != NULL, -2); @@ -483,19 +484,16 @@ #if GLIB_MAJOR_VERSION > 1 if (fle->file != NULL && !g_utf8_validate (fle->file, -1, NULL)) { + error = NULL; if ((tempstr = g_locale_to_utf8 (fle->file, -1, &bread, - &bwrite, NULL)) != NULL) + &bwrite, &error)) != NULL) { g_free (fle->file); fle->file = tempstr; } - else if ((tempstr = g_filename_to_utf8 (fle->file, -1, &bread, - &bwrite, NULL)) != NULL) - { - g_free (fle->file); - fle->file = tempstr; - } - + else + g_warning ("Error when converting %s to UTF-8: %s\n", fle->file, + error->message); } #endif