0

I have a machine with Linux Mint Debian Edition 2 "Betsy" (installed as RC, with all available updates applied) and MATE desktop environment. My problem is that in some applications special characters used in my mother tongue (Polish) and, as I have some folders and files containing are not handled correctly.

To be more specific: in mate-terminal, pluma (MATE text editor) and caja (file manager) and probably a few others I just didn't happen to check, any Polish special characters normally typed by Alt+letter are either ignored (no character printed -- in pluma and caja) or replaced with a question mark (in mate-terminal). Even vim, when run in mate-terminal, behaves this way, i.e. replaces special characters with question marks.

I don't think this is a system-wide problem. Why? Because when I switch to another tty and try to input those special characters in the terminal I encounter no problems. The same folder which by mate-terminal is displayed as zdj?cia in another tty is correctly labeled zdjęcia. It looks as though the problem is MATE-specific, since vim, when run in terminator, doesn't cause any problems.

Furthermore, I've tried debugging this in the following manner: in mate-terminal I listed my home directory (containing files and directories with Polish special characters) and redirected ls output to a test file. Then I switched to another tty and cat the test file -- the characters were printed correctly.

I've already tried dpkg-reconfigure locales. Language packs have been installed (and reinstalled in the process) via MATE Control Centre.

What do I try next?

EDIT:

In mate-terminal in graphical environment:

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

In tty1 (where character encoding works fine):

$ locale
LANG=en_GB.UTF-8
LANGUAGE=en_GB:en
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC=pl_PL.UTF-8
LC_TIME=en_GB.UTF-8
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY=pl_PL.UTF-8
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER=pl_PL.UTF-8
LC_NAME=pl_PL.UTF-8
LC_ADDRESS=pl_PL.UTF-8
LC_TELEPHONE=pl_PL.UTF-8
LC_MEASUREMENT=pl_PL.UTF-8
LC_IDENTIFICATION=pl_PL.UTF-8
LC_ALL=

EDIT:

grep -Rs pl_PL /etc ~/.?* yields, after removing "Binary file x matches pattern" and piping through sort | uniq:

/etc/default/locale
/etc/locale.alias
/etc/locale.gen
/etc/mdm/locale.conf
/home/marta/../marta/.bash_history
/home/marta/../marta/.config/user-dirs.locale
/home/marta/../marta/.linuxmint/mintMenu/apt.cache
/home/marta/../marta/.pam_environment
/home/marta/../marta/.xsession-errors
/home/marta/.bash_history
/home/marta/.config/user-dirs.locale
/home/marta/.linuxmint/mintMenu/apt.cache
/home/marta/.pam_environment
/home/marta/.xsession-errors

Yes, the computer's not actually mine, but never mind :)

Yet another EDIT:

The contents of files containing locale settings:

$ cat /etc/default/locale
LANG="en_GB.UTF-8"
LANGUAGE="en_GB:en"
LC_NUMERIC="pl_PL.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_MONETARY="pl_PL.UTF-8"
LC_PAPER="pl_PL.UTF-8"
LC_IDENTIFICATION="pl_PL.UTF-8"
LC_NAME="pl_PL.UTF-8"
LC_ADDRESS="pl_PL.UTF-8"
LC_TELEPHONE="pl_PL.UTF-8"
LC_MEASUREMENT="pl_PL.UTF-8"
$ cat /home/marta/.pam_environment
LC_NUMERIC="pl_PL.UTF-8"
LC_TIME=en_GB.UTF-8
LC_MONETARY="pl_PL.UTF-8"
LC_PAPER="pl_PL.UTF-8"
LC_IDENTIFICATION="pl_PL.UTF-8"
LC_NAME="pl_PL.UTF-8"
LC_ADDRESS="pl_PL.UTF-8"
LC_TELEPHONE="pl_PL.UTF-8"
LC_MEASUREMENT="pl_PL.UTF-8"
$ cat /home/marta/.config/user-dirs.locale
pl_PL
  • What is the output of the command locale in working and non-working terminals? – Gilles Apr 25 '15 at 12:09
  • @Gilles I've added appropriate output. – Erathiel Apr 26 '15 at 15:34
  • You've somehow ended up with "pl_PL.UTF-8" as a locale name instead of pl_PL.UTF-8, with the double quotes as part of the locale name. How exactly did you declare your preference for Polish? – Gilles Apr 26 '15 at 15:45
  • In MATE Control Centre -> Languages you have the options to set language (for language, inferface, date and time) and (separately) region settings (for numbers, currency, addresses, measurement). I've used that dialog for this, so it looks like a bug in there. However, if I export LC_ALL=pl_PL.UTF-8, the special characters are still not displayed properly, though the question marks... change. Before the command they are regular question marks, after it it's a question mark contained within a diamond. Not that the shape matters, but the change itself is interesting. – Erathiel Apr 26 '15 at 16:32
  • 1
    That's weird: the content of the files you posted looks fine to me. The LANGUAGE variable uses : to define fallbacks (try British English, and if that's not available, fall back to generic English). – Gilles May 1 '15 at 20:24
0

You probably have a .pam_environment file with double quotes around the values of the LC_ variables:

# WRONG
LC_TIME="en_US.UTF-8"

Instead, it should look like this (no quotes):

LC_TIME=en_US.UTF-8

So, either remove your .pam_environment file

mv ~/.pam_environment ~/.pam_environment.off

or edit it to remove the double-quotes around the values:

perl -i.bak -pe 's/"//g' ~/.pam_environment

For details, see this : "Generated locale files must not have double quotes" on Github in linuxmint/mintlocale

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.