1

I have a problem on my server, it's not recognizing the symbols, i already tried doing a lot of stuff on system locale, but nothing has fixed this.

I need to turn this (output of "ls" command):

'Um Maluco no Peda'$'\347''o' 'Um Milh'$'\343''o de Coisas' 'Voc'$'\352'' Nunca Esteve Sozinha - O Doc de Juliette' 'Vov'$'\364'' e Eu' 

Into this:

'Um Maluco no Pedaço' 'Um Milhão de Coisas' 'Você Nunca Esteve Sozinha - O Doc de Juliette' 'Vovô e Eu' 
1
  • 1
    So, what is your locale? What does locale output? Commented Jan 9, 2022 at 20:11

1 Answer 1

1

Your files have ISO88591 charset names (one byte per accentuated characters instead of 2), then they don’t fit the default charset which is UTF-8 nowadays.

To make ls not to escape these characters, you could type LANG=fr_FR.iso88591 (replace fr and FR by your language code, probably PT), then ls will not escape the accentuated ISO88591 characters. The available values are listed with localedef --list-archive. If none of the values are iso88591, you may need to add them with dpkg-reconfigure locales (Debian based system only).

But if you use a UTF8 terminal, characters won’t be printed normally… you should also use an iso88591 terminal.

An alternative to an iso88591 terminal is to type ls|iconv -f iso88591 -t utf-8 (Less practical).

Could you print us the $LANG value before changing its value (this will give the national code you should use instead of fr. Or type locale which is more complete). The localedef --list-archive output can be useful too. (Your environment also : KDE, Gnome…)

Note : if you plan to use these files in a UTF-8 environnement, you may need to rename them and avoid switching to an ISO88951 mode.

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.