1

I am mounting a NFS filesystem to a Debian, an Amazon Linux and an Ubuntu file system and they are showing different character encoding for file name.

An example file is displayed as follows in the corresponding systems:

Ubuntu:

スクリーンショット-2018-01-11-11.28.19.png

Debian:

'$'\343\202\271\343\202\257\343\203\252\343\203\274\343\203\263\343\202\267\343\203\247\343\203\203\343\203\210''-2018-01-11-11.28.19.png'

Amazon Linux:

???????????????????????????-2018-01-11-11.28.19.png

The problem I am having is, that I am running a Wordpress server in these and the Debian instance is returning errors because it cannot find the image file, which I am assuming is because of the filename difference.

Why there is such a different in the filename encoding between these distributions, even though all 3 of them are Debian based? And is there a fix for the Debian system?

output of locale: Note that although locale of Amazon Linux and Debian are the same, the filenames are displayed differently.

Debian:

locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE=UTF-8
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

Ubuntu:

LANG=C.UTF-8
LANGUAGE=
LC_CTYPE=C.UTF-8
LC_NUMERIC="C.UTF-8"
LC_TIME="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_PAPER="C.UTF-8"
LC_NAME="C.UTF-8"
LC_ADDRESS="C.UTF-8"
LC_TELEPHONE="C.UTF-8"
LC_MEASUREMENT="C.UTF-8"
LC_IDENTIFICATION="C.UTF-8"
LC_ALL=

Amazon Linux:

locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LC_CTYPE=UTF-8
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

Thank you.

4
  • 2
    Character set mappings are managed through locales. Please add the output of locale for each of the three systems to your question. (Each one should be about 15 lines.) Commented Mar 31, 2022 at 8:25
  • 1
    In addition to what @roaima wrote, also consider docs.oracle.com/cd/E56021_01/html/E55851/gokvz.html
    – MC68020
    Commented Mar 31, 2022 at 8:41
  • 1
    @roaima Thank you. I added the output of locale.
    – madu
    Commented Mar 31, 2022 at 8:57
  • 1
    That's great. Almost there. Please could you also add the output of locale -a, again from each system. The previous command showed the currently selected (or intended) locale. This one shows the available locales. I suspect that en_US.UTF-8 is not available on your two problematic servers. Commented Mar 31, 2022 at 12:41

1 Answer 1

1

There is a mismatch between the set of available locales and the selected intended locale. The locale -a command will show the available locales, and locale shows the currently selected locale.

Ubuntu: C.UTF-8 Debian: en_US.UTF-8 Amazon: en_US.UTF-8

The en_US.UTF-8 locale is not available on Debian or Amazon Linux. The locale -a command will show whether C.UTF-8 is available there.

If you run this command (as root) on the Debian and Amazon Linux servers, you can not only select the set of locales to generate but then on the next screen you will get the option to select the system-default locale.

dpkg-reconfigure locales

You should either ensure that en_US.UTF-8 is built on the Debian and Amazon Linux systems, or that (assuming C.UTF-8 is already selected there) C.UTF-8 is selected as the system default.

Without one of the many UTF-8 locales being selected, the user interface cannot know that you expect the byte string $'\343\202\271\343\202\257\343\203\252\343\203\274\343\203\263\343\202\267\343\203\247\343\203\203\343\203\210' to be interpreted and displayed as スクリーンショット.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .