# HG changeset patch # User masneyb # Date 1096336734 0 # Node ID 6dcef47f3187f5b7dba27848d9a0b7e80a47a721 # Parent 3adfe34b1a77f1716ee39b1c0dbfb07144cfbb9b 2004-9-27 Brian Masney * lib/protocols.c (gftp_put_file) docs/gftp-faq.sgml - use gftp_string_from_utf8() to encode the filename. This will use the remote_charsets option instead of the GLIB environment variable diff -r 3adfe34b1a77 -r 6dcef47f3187 ChangeLog --- a/ChangeLog Tue Sep 28 01:54:46 2004 +0000 +++ b/ChangeLog Tue Sep 28 01:58:54 2004 +0000 @@ -1,4 +1,8 @@ 2004-9-27 Brian Masney + * lib/protocols.c (gftp_put_file) docs/gftp-faq.sgml - use + gftp_string_from_utf8() to encode the filename. This will use the + remote_charsets option instead of the GLIB environment variable + * lib/protocols.c (gftp_string_from_utf8) - fixes for encoding the strings in the users' locale @@ -2866,7 +2870,7 @@ * cvsclean - added this script - * *.[ch] - added $Id: ChangeLog,v 1.330 2004/09/28 01:54:46 masneyb Exp $ tags + * *.[ch] - added $Id: ChangeLog,v 1.331 2004/09/28 01:58:54 masneyb Exp $ tags * debian/* - updated files from Debian maintainer diff -r 3adfe34b1a77 -r 6dcef47f3187 docs/gftp-faq.sgml --- a/docs/gftp-faq.sgml Tue Sep 28 01:54:46 2004 +0000 +++ b/docs/gftp-faq.sgml Tue Sep 28 01:58:54 2004 +0000 @@ -6,7 +6,7 @@ - $Date: 2004/09/28 01:39:50 $ + $Date: 2004/09/28 01:58:54 $ gFTP FAQ @@ -279,19 +279,6 @@ -Filenames are being stored in UTF8 instead of the current locale. - - -Starting with gFTP 2.0.18, you can use the GLIB environment variable -G_FILENAME_ENCODING to specify the encoding of the files -on your system. For more information about this environment variable, see -http://developer.gnome.org/doc/API/2.0/glib/glib-running.html#G_FILENAME_ENCODING. - - - - - - When using an external editor, gFTP does not detect changes that are being made to the file. diff -r 3adfe34b1a77 -r 6dcef47f3187 lib/protocols.c --- a/lib/protocols.c Tue Sep 28 01:54:46 2004 +0000 +++ b/lib/protocols.c Tue Sep 28 01:58:54 2004 +0000 @@ -187,9 +187,7 @@ gftp_put_file (gftp_request * request, const char *filename, int fd, off_t startsize, off_t totalsize) { - char *tempstr, *enc_filename; - gsize bread, bwrite; - GError * error; + char *enc_filename; int ret; g_return_val_if_fail (request != NULL, GFTP_EFATAL); @@ -198,17 +196,8 @@ if (request->put_file == NULL) return (GFTP_EFATAL); - if (g_utf8_validate (filename, -1, NULL)) - enc_filename = g_filename_from_utf8 (filename, -1, &bread, &bwrite, &error); - else - { - tempstr = gftp_string_to_utf8 (request, filename); - enc_filename = g_filename_from_utf8 (tempstr, -1, &bread, &bwrite, - &error); - g_free (tempstr); - } - - if (enc_filename) + enc_filename = gftp_string_from_utf8 (request, filename); + if (enc_filename != NULL) { ret = request->put_file (request, enc_filename, fd, startsize, totalsize); g_free (enc_filename);