diff lib/misc.c @ 830:afbe37351940

2006-10-19 Brian Masney <masneyb@gftp.org> WARNING: The CVS version of gFTP is currently broken, especially for international users. This will be fixed in a few days. * src/gtk/gtkui.c src/gtk/gtkui_transfer.c src/gtk/misc-gtk.c lib/gftp.h lib/misc.c lib/protocols.c - removed code that converts the filename to UTF8. This will be handled by the library. Removed utf8_file member from the gftp_file structure. * lib/rfc959.c - convert the file or directory from UTF8 to the proper locale when sending a command to the server. * src/uicommon/gftpui.c src/gtk/menu-items.c lib/misc.c lib/gftp.h (gftp_gen_ls_string) - convert the filename from UTF8 to the proper locale before it is displayed to the user.
author masneyb
date Thu, 19 Oct 2006 11:41:04 +0000
parents b282e346bd25
children 57aad6d4b304
line wrap: on
line diff
--- a/lib/misc.c	Sun Oct 15 18:45:06 2006 +0000
+++ b/lib/misc.c	Thu Oct 19 11:41:04 2006 +0000
@@ -458,9 +458,6 @@
   if (fle->file)
     newfle->file = g_strdup (fle->file);
 
-  if (fle->utf8_file)
-    newfle->utf8_file = g_strdup (fle->utf8_file);
-
   if (fle->user)
     newfle->user = g_strdup (fle->user);
 
@@ -873,9 +870,10 @@
 
 
 char *
-gftp_gen_ls_string (gftp_file * fle, char *file_prefixstr, char *file_suffixstr)
+gftp_gen_ls_string (gftp_request * request, gftp_file * fle,
+                    char *file_prefixstr, char *file_suffixstr)
 {
-  char *tempstr1, *tempstr2, *ret, tstr[50], *attribs;
+  char *tempstr1, *tempstr2, *ret, tstr[50], *attribs, *utf8;
   struct tm *lt;
   time_t t;
 
@@ -902,9 +900,10 @@
   if (file_suffixstr == NULL)
     file_suffixstr = "";
 
+  utf8 = gftp_string_from_utf8 (request, fle->file);
   ret = g_strdup_printf ("%s %s %s %s%s%s", tempstr1, tempstr2, tstr, 
                          file_prefixstr, 
-                         fle->utf8_file != NULL ? fle->utf8_file : fle->file,
+                         utf8 != NULL ? utf8: fle->file,
                          file_suffixstr);
 
   g_free (tempstr1);