[SOLVED] Wrong charsets on new files on Ubuntu Unity 20.04
by Shinare from LinuxQuestions.org on (#5ETZC)
Whenever I create a new text file with nano or gedit, (At least with no extension, with .txt and with .php)
the file's charset is us-ascii while it should be utf-8. New files used to always be utf-8 until about one hour ago when I downloaded a text file with us-ascii. The only thing I did with it was copy its contents to clipboard, so it shouldn't cause any system changes, but it's the only related thing that happened.
I've also tried to manually change new files' charsets with Code:iconv file -f us-ascii -t utf-8 -o file but it doesn't do anything.
Code:$ locale
LANG=en_US.UTF-8
LANGUAGE=en
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL=en_GB.UTF-8This is the only possibly relevant command I could find, and it says UTF-8 everywhere.


the file's charset is us-ascii while it should be utf-8. New files used to always be utf-8 until about one hour ago when I downloaded a text file with us-ascii. The only thing I did with it was copy its contents to clipboard, so it shouldn't cause any system changes, but it's the only related thing that happened.
I've also tried to manually change new files' charsets with Code:iconv file -f us-ascii -t utf-8 -o file but it doesn't do anything.
Code:$ locale
LANG=en_US.UTF-8
LANGUAGE=en
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL=en_GB.UTF-8This is the only possibly relevant command I could find, and it says UTF-8 everywhere.