5 kx #!/bin/csh
5 kx #
5 kx # Description: This script sets the environment variables G_FILENAME_ENCODING
5 kx # and G_BROKEN_FILENAMES for the glib-2.0 library.
5 kx #
5 kx # G_FILENAME_ENCODING
5 kx # This environment variable can be set to a comma-separated list of
5 kx # character set names. GLib assumes that filenames are encoded in the
5 kx # first character set from that list rather than in UTF-8. The special
5 kx # token "@locale" can be used to specify the character set for the
5 kx # current locale.
5 kx #
5 kx # G_BROKEN_FILENAMES
5 kx # If this environment variable is set, GLib assumes that filenames are
5 kx # in the locale encoding rather than in UTF-8.
5 kx
5 kx # If the LANG you have set contains any form of "UTF", we will guess you are
5 kx # using a UTF-8 locale. Hopefully we're correct.
5 kx echo $LANG | grep -iq UTF
5 kx if ($status == 0) then
5 kx setenv G_FILENAME_ENCODING "@locale"
5 kx endif
5 kx
5 kx # It doesn't hurt to export this since G_FILENAME_ENCODING takes priority
5 kx # over G_BROKEN_FILENAMES:
5 kx setenv G_BROKEN_FILENAMES 1
5 kx