Mac/Linux users: You can use the file filename terminal command to quickly identify file information. Occasionally you will come across files that have an incorrect or missing file extension. As shown ...
XML files have a header describing what encoding they are in. If this is correct, you're done. However, ASCII is a subset of UTF-8 so you can safely assume everything is UTF-8 and parse it.
Linux typically doesn't rely on file extensions; it gets a files type using "magic numbers" within the file itself. Linux apps, including GNOME Files, may still use extensions to determine file type.