# Revision history [back]

The 3-letter filename extension (eg .exe, .htm, .xls) is advisory rather than enforced. In Windows™, the system maintains a database of such sets of 3 letters & uses that database to know what program to use to open the file. That facility has been used extensively by hackers (as one example, renaming an EXE file to ZIP; the user part of the OS will report it as a zip archive, but the system knows that it is an executable file and will allow it to hack your system if it is double-clicked).

The previous paragraph also explains why you are experiencing such encoding problems:- it is a question of the degree of intelligence encoded--or not--into the program that you are using. As a good example, your web browser does not care what the images within your web-page are called; in other words, it does NOT use a Database of file extensions in the Windows™ user-level manner, but rather "sniffs" the file to discover it's mime-type. That means, as just one example, that you could call a jpeg image "img.gif" & your browser would still open it correctly.

PS
You say that:-

The file's content is html

That is almost certainly wrong. I would expect that the mime-type is XML rather than HTML.

The 3-letter filename extension (eg .exe, .htm, .xls) is advisory rather than enforced. In Windows™, the system maintains a database of such sets of 3 letters & uses that database to know what program to use to open the file. That facility has been used extensively by hackers (as one example, renaming an EXE file to ZIP; the user part of the OS will report it as a zip archive, but the system knows that it is an executable file and will allow it to hack your system if it is double-clicked).

The previous paragraph also explains why you are experiencing such encoding problems:- it is a question of the degree of intelligence encoded--or not--into the program that you are using. As a good example, your web browser does not care what the images within your web-page are called; in other words, it does NOT use a Database of file extensions in the Windows™ user-level manner, but rather "sniffs" the file to discover it's mime-type. That means, as just one example, that you could call a jpeg image "img.gif" & your browser would still open it correctly.

PS
You say that:-

The file's content is html

That is almost certainly wrong. I would expect that the mime-type is XML rather than HTML.

PPS
I'm glad that you got it all sorted, lolax, but it is almost impossible to say why you are having such problems. There are too many variables + the language does no help. As one example, you say:-

lolax: I open that file from notepad and choose the encode from UTF-8 into Unicode and save it

utf8 is an 8-bit character encoding for Unicode code-points, chosen by almost all Linux distributions as their default text encoding + chosen by the W3C as the default for xml + html5. Microsoft™ made their own, 16-bit version of Unicode for Windows NT™, and insist on calling it "Unicode" (as if it was the only one - Unicode' is the standard for the code-points & not the encoding mechanism).

There are many types of encoding mechanisms for Unicode code-points (eg ucs-2, utf-7, utf-8, utf-16, utf-32, and so on) ('Windows™ Unicode" is actually utf-16 internally).

An XLS file is actually a zip file archive. Inside the archive are many files, many of which are in the XML format. The first statement of an xml file is a statement of the character encoding of the text within. The default encoding for all xml files is utf-8'.

Finally, it may well be possible to save an XLS/ODS file as a web-page document', but it will no longer be a spreadsheet in the sense of an Excel/Calc spreadsheet. I hope that that is self-evident.

The 3-letter filename extension (eg .exe, .htm, .xls) is advisory rather than enforced. In Windows™, the system maintains a database of such sets of 3 letters & uses that database to know what program to use to open the file. That facility has been used extensively by hackers (as one example, renaming an EXE file to ZIP; the user part of the OS will report it as a zip archive, but the system knows that it is an executable file and will allow it to hack your system if it is double-clicked).

The previous paragraph also explains why you are experiencing such encoding problems:- it is a question of the degree of intelligence encoded--or not--into the program that you are using. As a good example, your web browser does not care what the images within your web-page are called; in other words, it does NOT use a Database of file extensions in the Windows™ user-level manner, but rather "sniffs" the file to discover it's mime-type. That means, as just one example, that you could call a jpeg image "img.gif" & your browser would still open it correctly.

PS
You say that:-

The file's content is html

That is almost certainly wrong. I would expect that the mime-type is XML rather than HTML.

PPS
I'm glad that you got it all sorted, lolax, but it is almost impossible to say why you are having such problems. There are too many variables + the language does no help. As one example, you say:-

lolax: I open that file from notepad and choose the encode from UTF-8 into Unicode and save it

utf8 is an 8-bit character encoding for Unicode code-points, chosen by almost all Linux distributions as their default text encoding + chosen by the W3C as the default for xml + html5. Microsoft™ made their own, 16-bit version of Unicode for Windows NT™, and insist on calling it "Unicode" (as if it was the only one - Unicode' is the standard for the code-points & not the encoding mechanism).

There are many types of encoding mechanisms for Unicode code-points (eg ucs-2, utf-7, utf-8, utf-16, utf-32, and so on) ('Windows™ Unicode" is actually utf-16 internally).

An XLS file is actually a zip file archive. Inside the archive are many files, many of which are in the XML format. The first statement of an xml file is a statement of the character encoding of the text within. The default encoding for all xml files is utf-8'.

Finally, it may well be possible to save an XLS/ODS file as a web-page document', but it will no longer be a spreadsheet in the sense of an Excel/Calc spreadsheet. I hope that that is self-evident.