perl: warning: Setting locale failed.
Mensagens de erro estranhas quando executa scripts em perl?
Veja como corrigir
Problema
Abaixo o erro que costuma aparecer
1 2 3 4 5 6 7 8 | perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LC_CTYPE = "UTF-8", LANG = "en_US.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). |
Correção
Vamos exportar algumas variáveis com a codificação utilizada pelo sistema, no meu caso eu uso o sistema em inglês e codificação UTF8
1 2 3 | export LANGUAGE=en_US.UTF-8 export LANG=en_US.UTF-8 export LC_ALL=en_US.UTF-8 |
Vamos agora executa o comando locale-gen en_US.UTF-8 para reconfigurar o sistema.
1 2 3 4 5 | # locale-gen en_US.UTF-8 Generating locales (this might take a while)... en_US.UTF-8... done en_US.UTF-8... done Generation complete. |
Debian
No Debian é necessário reconfigurar o sistema utilizando o dpkg-reconfigure
1 2 3 4 5 | # dpkg-reconfigure locales Generating locales (this might take a while)... en_US.UTF-8... done en_US.UTF-8... done Generation complete. |
CentOS
No CentOS edite o arquivo /etc/sysconfig/i18n
1 | vi /etc/sysconfig/i18n |
Adicione ou altère a linha abaixo
1 | LC_CTYPE="en_US.UTF-8" |
Abraços
Obrigado pela solução.
Tks.
Evandro(Citar)