I know you were skeptikal about this on another topic but it’s probably not (only) about the extension, it’s more about the mime type?
Edit, wrong assertion:
Summary
Unfortunately, the mime type is not consistent…
user@disp4678:~$ touch empty.txt
user@disp4678:~$ xdg-mime query filetype empty.txt
text/plain
user@disp4678:~$ file --mime-type -b empty.txt
inode/x-empty