pspp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with non-ascii filenames on a non utf-8 locale


From: John Darrington
Subject: Re: Problem with non-ascii filenames on a non utf-8 locale
Date: Sat, 8 May 2010 08:48:34 +0000
User-agent: Mutt/1.5.18 (2008-05-17)

On Sat, May 08, 2010 at 12:35:09AM -0300, Michel Boaventura wrote:
>
> More about the filename issue:
>
> Glib manual says (on  
> http://library.gnome.org/devel/glib/stable/glib-Character-Set-Conversion.html#file-name-encodings-checklist):
>
> "If you get a file name from the file system from a function such as  
> readdir(3) or gtk_file_chooser_get_filename(), you do not need to do any  
> conversion to pass that file name to functions like open(2), rename(2),  
> or fopen(3) ? those are "raw" file names which the file system 
> understands."
>
> If I understand this right, since we get filename directly from the  
> command line, we don't need to convert
> it to open the file. If the locale support utf8 or not, we will get the  
> string on the same locale that
> we need to open the file. So we may not need the two step conversion  
> from load_data_file function.
>
> But we do need to convert it to show the name on syntax:
> "If you need to display a file name, convert it to UTF-8 first by using  
> g_filename_to_utf8()..."
>
> I don't know if this function is used to open file in other contexts,  
> like syntax files, or File -> Open menu but, if not,
> I think we should get rid of the two step conversion from load_data_file  
> function.

This analysis is basically correct.  
However a complication arises due to the fact that we can only load a data 
file, by
creating the necessary syntax, and running that syntax.  (At least that's the 
way it
has always worked, and departing from this design would be a radical move)

You said that you couldn't open files with non-ascii characters.  Does this 
problem
arise on GNU/Linux or only on Windows?  On my GNU/Linux system, I can open both 
ISO-8859-1 and 
UTF8 encoded filenames without problem.  The only caveat is that I do get that 
Pango 
warning when I load a ISO-8859-1 filename because it cannot display the 
filename in the syntax
window.

If you are finding that only Windows cannot load the file, then I suspect the 
problem is
related to the function convert_glib_filename_to_system_filename which is in 
src/ui/gui/helper.c

Perhaps you can give more details of what is working for you and what is not.  
Then we
can come up with a proper solution (I hope).

J'

-- 
PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See http://pgp.mit.edu or any PGP keyserver for public key.


Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]