Saya menggunakan Ubuntu 12.04 dan setelah pembaruan otomatis itu mengubah bentuk sistem penyandian standar UTF-8 menjadi "ANSI_X3.4-1968". Saya menyadari bahwa ketika komentar kode saya di Eclipse muncul dengan karakter aneh, dan setelah menyadari bahwa IDE itu tidak bersalah, saya telah membuka terminal untuk memeriksa. Saat saya mengetik karakter latin di jendela terminal, seperti çãõéèê ..., tanda tanya malah muncul. Sama saya 'kucing' file teks. Mengubah pengaturan lokal Ubuntu oleh GUI membuat crash-daemon akun:
ExecutablePath: /usr/bin/gnome-language-selector
ProcCmdline: /usr/bin/python /usr/bin/gnome-language-selector
...
File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking message, timeout)
DBusException: org.freedesktop.Accounts.Error.Failed: running '/usr/share/language-tools/save-to-pam-env' failed: no output
Saya kemudian mengubah save-to-pam-env menambahkan baris debug dan mengeksekusi pemilih-lang di terminal:
gag@desktop~> /usr/bin/python /usr/bin/gnome-language-selector
(gnome-language-selector:17733): Gtk-WARNING **: Locale not supported by C library.
Using the fallback 'C' 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_COLLATE to default locale: No such file or directory
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "pt_BR"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
...same message a dozen times...
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
/usr/lib/python2.7/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py:858: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
self._localeinfo.translate(loc, native=True) == defaultLangName):
//the line below is my debug 'print'
exec: /usr/share/language-tools/save-to-pam-env /home/likewise-open/CERTI/gag pt_BR.UTF-8
Jadi, jalankan perintah ini dengan tangan:
gag@desktop~> /usr/share/language-tools/save-to-pam-env /home/likewise-open/CERTI/gag pt_BR.UTF-8
pt_BR.UTF-8
gag@ccd-7840~> locale
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
gag@desktop~> cat .pam_environment
LANGUAGE=en
LANG=en_US.UTF-8
LC_NUMERIC=pt_BR.UTF-8
LC_TIME=pt_BR.UTF-8
LC_MONETARY=pt_BR.UTF-8
LC_PAPER=pt_BR.UTF-8
LC_NAME=pt_BR.UTF-8
LC_ADDRESS=pt_BR.UTF-8
LC_TELEPHONE=pt_BR.UTF-8
LC_MEASUREMENT=pt_BR.UTF-8
LC_IDENTIFICATION=pt_BR.UTF-8
Semua tampak baik-baik saja, tetapi me-restart PC dan masuk kembali hal-hal masih sama. Dengan CLI saya dapat melihat bahwa lokal diinstal dengan benar:
gag@desktop~> locale -a | grep pt
pt_BR.utf8
pt_PT.utf8
gag@desktop~> locale -m | grep UTF
UTF-8
Saya juga sudah mencoba:
sudo apt-get install language-pack-pt language-pack-pt-base
sudo apt-get install --reinstall locales
Tanpa efek. Ketika saya masuk dengan akun lain, pengkodeannya ok. Ide ide?