Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Note: The real problems behind this are presented here, as per a recommendation on meta. This question should be closed as a non-reproducible off-topic because its main problem is solved by correcting a typo.

Hi fellows,

I have tried to follow various official tutorials and questions and supposed solutions (a few only appliying to, say Debian based distros), none of which worked. Adding things like LANG="pt_PT.UFT-8" in ~/.bashrc didn/t work either, although it quiets the man warning (but generated a few warnings like bash: can't set $LC_CTYPE (...) loading the shell after login):

man: can't set the locale; make sure $LC_* and $LANG are correct

My locale.conf file, which BTW has experienced a lot of combinations of LC* and LANG* variables:


The result of some other commands:

[jmcf125@jmcf125-Toshiba-Arch ~]$ locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory

[jmcf125@jmcf125-Toshiba-Arch ~]$ locale -a
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
[jmcf125@jmcf125-Toshiba-Arch ~]$ localectl
   System Locale: LANG=pt_PT.UFT-8
       VC Keymap: pt-latin9
      X11 Layout: pt

locale.gen (no comments):

en_US.UTF-8 UTF-8
pt_PT.UTF-8 UTF-8

locale-gen has always returned:

Generating locales...
Generation complete.

I have also tried uft8 instead of UFT-8 (that was part of the Ubuntu solution I used back then), with no good results (although I didn't try it in many places).

Besides, the keyboard on X is not pt-latin9, even if I do loadkeys pt-latin9 and related commands, although that's not my main problem right now. That is another question. The current problem is that Non ASCII characters are not displayed right (not in the tty, much less in X).

For example, if I click the key for c cedilla, I get a majuscule A with a trema, and I can delete am additional character of the prompt with Backspace! I suspect this is because the TTY expects 2 bytes to be 2 characters, and allows for an extra backspace. While ls gives a question mark per byte of the character (example: Transfer??ncias), Tab completion gives Transferências/ on X and something else (other non ASCII character) on a TTY.

I hope you can help me, this is really annoying and I don't know what else to do. Even while writing this question, I mistyped ' for / almost every time!

share|improve this question

closed as off-topic by Ignacio Vazquez-Abrams, Braiam, terdon, Karlson, vonbrand Jan 27 at 1:33

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Ignacio Vazquez-Abrams, Braiam, terdon, Karlson, vonbrand
If this question can be reworded to fit the rules in the help center, please edit the question.

Seems your mistyping is causing you more problems than you intially thought... –  jasonwryan Jan 13 at 0:57
@jasonwryan, I certainly did not see this coming. I feel so stupid right now... –  JMCF125 Jan 13 at 10:05
We all do stupid things; the trick is to only do them once... :) –  jasonwryan Jan 13 at 10:08
The worst is this isn't over, the TTY still displays wrong characters (others instead of ??, but still), the keyboard is the same way (wrong in X and TTY), the only thing that works is the printing of Unicode characters on X. Now to take the typos out of here... –  JMCF125 Jan 13 at 10:36
Important note: rolled back as recommended here. I'll fork this ASAP. –  JMCF125 Jan 26 at 17:11

1 Answer 1

up vote 4 down vote accepted

The output of locale -a is telling you that you have a locale named pt_PT.utf8. But you keep trying to use pt_PT.UFT-8, which doesn't exist. Use


pt_PT.UTF-8 should work also, but it's UTF-8, not UFT-8. The T comes before the F.

share|improve this answer
I did that quite a long time ago, and have discovered how to set the keyboard right in the X. Can you help me find out how to change the charset of the TTY? –  JMCF125 Jan 23 at 11:21
Please see the forks. –  JMCF125 Jan 26 at 21:13

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