Filename containing French characters ?

Polytropon freebsd at edvax.de
Mon May 23 15:46:02 UTC 2011


On Mon, 23 May 2011 06:54:44 +0200, Frank Bonnet <f.bonnet at esiee.fr> wrote:
> when I type the "ls -l" command the file is displayed
> with a "?" in place of the French (accentuated ) character

That's typical for console operations (text mode) when
UTF-coded characters are encountered. The text mode console
does not support UTF-8 and does display "?" whenever it
encounters a nonprintable character.




> I tried UTF8 or iso8859-1 as MM-CHARSET and fr_FR.ISO8859-1 as LANG
> global variables but it still don-t work

Depending on what actual file system the file is located,
you may need to define a "translation" mode (e. g. -C or -W
in combination with mount_ntfs).

You also have to make sure that if you change language
settings, your console has to support it.

As a german user, I can use german Umlauts and Eszett
with the text mode console as I don't use UTF nonsense
for that.

For example, I have

	ttyv0  "/usr/libexec/getty Pc"  cons25l1  on  secure
up to

	ttyv7  "/usr/libexec/getty Pc"  cons25l1  on  secure

in /etc/ttys.

For language settings, please see that FreeBSD does, next
to $LANG, also use $LC_* variables. To use language-specific
characters when running programs (less, mcedit, vi, anything
that inputs or outputs file data), the following settings
are made in /etc/csh.cshrc (my default shell, system-wide
settings):

	setenv  LC_ALL          en_US.ISO8859-1
	setenv  LC_MESSAGES     en_US.ISO8859-1
	setenv  LC_COLLATE      de_DE.ISO8859-1
	setenv  LC_CTYPE        de_DE.ISO8859-1
	setenv  LC_MONETARY     de_DE.ISO8859-1
	setenv  LC_NUMERIC      de_DE.ISO8859-1
	setenv  LC_TIME         de_DE.ISO8859-1

This makes program messages being in English (preferred),
but sets some conventions specific to Germany.

I'm sure you can do something similar with the correct
language settings and pages for French. It also works
with Unicode when using programs that are capable of
employing UTF-8 with "setenv LANG de_DE.UTF-8". In this
case, even chinese characters can be used, given the
proper fonts.

Still, I may emphasize that it's NOT good to have non-ASCII
characters in file names. Things like spaces, quotes,
backslashes, et, curly braces and other special characters
_are_ possible in file names, but they do not belong there.
On the systems I had to maintain, I adviced my children...
erm... users! :-) to only use lowercase letters and _ instead
of space, combined with a corporate-given naming convention
for work files that had to be managed by the users.

A solution (that does solve the problem, not its cause)
would be to install the Midnight Commander and use it in
a UTF-8 capable terminal in X (but also works in text
mode), move the cursor to a file and press PF6 (rename),
then enter a name in ASCII. Using this approach, you don't
have to enter the original file name ????????.???. :-)



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list