Re: character sets and filenames

Sam Varshavchik <[email protected]> Tue, 09 Mar 2004 20:49:05 -0500
Newsgroups gmane.comp.audio.zinf.devel
Message-ID <[email protected]>
Kristian G. Kvilekval writes:

> I've seen some problems when scanning filenames
> with foreign characters and I was hoping somebody
> would have some suggestions.
> 
> Say, for example, I have 
> 
>   /home/music/luiz_macedo-bossa_electromagn<E9>tica.m3u
> 
> Currently this is failing to be encoded as a URL
> by the routine  FilePathToURL which in turn
> is implemented with g_filename_to_uri
> 
>>From reading the URI/URL documentation, I would
> expect this to be encoded as 
> 
>   /home/music/luiz_macedo-bossa_electromagn%E9tica.m3u
> 
> My initial reaction is that it's a bug in glib, but
> on the other hand  the documentation says for g_filename_to_uri:
> 
> filename : an absolute filename specified in the encoding used for
> filenames by the operating system.
> 
> And the filename passed in is probably not considered legal (but
> actually works fine).
> 
> Would someone like to clarify?

The user used an encoding other than the "encoding used by the operating 
system."

By fiat, Unix filenames have been decreed to be using UTF-8; still plenty of 
stuff creates files using iso-8859-1, et al…

There is no easy solution for this one.
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQBATnQRx9p3GYHlUOIRAhxIAJsF2kEN5vwDL2N1AfX/l8idWGhboACaAn+K
aL6qucYbzeRIWgemFO0PFyM=
=ci0K
-----END PGP SIGNATURE-----