file -i provide two different charsets for the same file on the same FS
0
votes
0
answers
21
views
I'm a bit confuse about a behavior of the
file -i
command. I searched a while and give up since I didn't have a sufficient knowledge regarding encoding as well as linux file
command (to stay concise about my lack of knowledge...).
The situation is the following one:
- Considering a file sample-input.xml
store behind /a/specific/path/in/the/fs
.
- Considering the shell current working directory as /a/specific/path
.
Commands:
1. First case
- Command: /a/specific/path/$ file -i /a/specific/path/in/the/fs/sample-input.xml
.
- Output: /a/specific/path/in/the/fs/sample-input.xml: text/xml; charset=iso-8859-1
2. Second case
- Command: /a/specific/path/$ file -i in/the/fs/sample-input.xml
.
- Output: in/the/fs/sample-input.xml: text/xml; charset=utf-8
Is somebody able to explain the difference for both charsets since the command is reading the same file?
Asked by ollie314
(101 rep)
Nov 20, 2024, 01:34 PM