this post was submitted on 23 Sep 2023
6 points (100.0% liked)
OpenBSD
579 readers
1 users here now
General OpenBSD community!
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I explored the source of file(1) and the part to determine file types of text file seems to be in text.c: https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/usr.bin/file/text.c?rev=1.3&content-type=text/plain
And especially this part:
So file(1) is not capable of saying if a file is UTF-8 right now. There is some other file (
/etc/magic
) which can help to determine if a text file is UTF-7 or UTF-8-EBCDIC because those need a BOM but as you said UTF-8 does not need a BOM. So it looks like we are stuck here :)Thank you. At least I know now that it's the expected output of utf-8 files, that's good to know. Thank you again.
Which is ironic, given that OpenBSD only supports the UTF-8 encoding :)
Yes it looks like utf8 is a first-class citizen but really it is ASCII which is 100% supported. From the FAQ: