Re: g_filename_to/from_utf8()



Owen Taylor wrote:
On Mon, 2004-02-02 at 15:25, Egon Andersen wrote:

Sven Neumann wrote:

Egon Andersen <post talura dk> writes:


I've had some problems with g_filename_to/from_utf8().

The encoding of the returned string depends on the encoding of
your locale but only if you have the environment variable
G_BROKEN_FILENAMES set.


Okay, this gave me some info about why the platforms behaves like they do.
It seems strange that G_BROKEN_FILENAMES is not set on RH7.3, but it is set to 1 on RH9... and apparently it should have been the opposite! Do this really mean that I can't rely on the default setup on neither RH7.3 nor RH9 or other Linux distros?
(I haven't done any manual changes around G_BROKEN_FILENAMES.)
I thought (hoped?) the idea was to make it easier to make portable applications ;-)


If G_BROKEN_FILENAMES is set, then the encoding if
g_filename_to/from_utf8 is the encoding of your locale. The default
locales on RH9 are UTF-8 locales, but you apparently have a different
setting.

On RH7:
locale gives
LANG=en_GB
LC_CTYPE="en_GB"
LC_NUMERIC="en_GB"
LC_TIME="en_GB"
LC_COLLATE="en_GB"
LC_MONETARY="en_GB"
LC_MESSAGES="en_GB"
LC_PAPER="en_GB"
LC_NAME="en_GB"
LC_ADDRESS="en_GB"
LC_TELEPHONE="en_GB"
LC_MEASUREMENT="en_GB"
LC_IDENTIFICATION="en_GB"
LC_ALL=

and env gives no G_BROKEN_FILENAMES

On RH9:
locale gives
LANG=en_DK.UTF-8
LC_CTYPE="en_DK.UTF-8"
LC_NUMERIC="en_DK.UTF-8"
LC_TIME="en_DK.UTF-8"
LC_COLLATE="en_DK.UTF-8"
LC_MONETARY="en_DK.UTF-8"
LC_MESSAGES="en_DK.UTF-8"
LC_PAPER="en_DK.UTF-8"
LC_NAME="en_DK.UTF-8"
LC_ADDRESS="en_DK.UTF-8"
LC_TELEPHONE="en_DK.UTF-8"
LC_MEASUREMENT="en_DK.UTF-8"
LC_IDENTIFICATION="en_DK.UTF-8"
LC_ALL=

and env gives G_BROKEN_FILENAMES=1

So it seems that my locales should be okay, but not the G_BROKEN_FILENAMES


Are there anything else than the locale/language setup that could cause G_BROKEN_FILENAMES to be erroneous?

(And actually the machine with RH9 is installed with a minimum of changes of default settings, simply as one of its purposes is to have a 'clean' reference to test programs on.)

Best regards
Egon Andersen




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