Guessing UTF-8 encoding
- by Dervin Thunk
I have a question that may be quite naive, but I feel the need to ask, because I don't really know what is going on. I'm on Ubuntu.
Suppose I do
echo "t" > test.txt
if I then
file test.txt
I get test.txt:ASCII text
If I then do
echo "å" > test.txt
Then I get
test.txt: UTF-8 Unicode text
How does that happen? How does file "know" the encoding, or, alternatively, how does it guess it?
Thanks.