Gildas vor 2 Jahren
Ursprung
Commit
e22e67667a
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      faq.md

+ 1 - 1
faq.md

@@ -38,6 +38,6 @@ You can also disable the options below. Some resources (e.g. images, frames) on
  - Images > save deferred images
 
 ## How does the self-extracting ZIP format work?
-The self-extracting ZIP files created by SingleFile are essentially regular ZIP files. They take advantage of the flexibility in the ZIP specification, which allows for additional data to be included before and after the main payload. In the case of SingleFile, this feature is used to make the ZIP file appear as an HTML file. As a result, the resulting HTML page is technically invalid because it contains binary data, but it's within the bounds of the HTML specification to allow for such cases. Within this file, there is also a script designed to unpack the ZIP payload when the page is opened in a web browser.
+The self-extracting ZIP files created by SingleFile are essentially regular ZIP files. They take advantage of the flexibility in the ZIP specification, which allows for additional data to be included before and after the main payload. In the case of SingleFile, this feature is used to make the ZIP file appear as an HTML file. As a result, the resulting HTML page is technically invalid because it contains binary data, but it's within the bounds of the HTML specification to allow for such cases. Within this file, there is also a script designed to extract the ZIP payload when the page is opened in a web browser.
 
 The purpose of this script is to interpret the ZIP payload as binary data and then extract it. Initially, the script can use the `window.fetch()` method to read the page in binary form. However, this method doesn't work as expected in Chromium-based browsers when the page is accessed from the local file system due to security restrictions. To circumvent this, the page is encoded in windows-1251, and binary data is directly retrieved from the Document Object Model (DOM). The choice to use windows-1251 encoding, rather than UTF-8, was made because, in UTF-8, any invalid characters are converted into the "U+FFFD REPLACEMENT CHARACTER," making it impractical for this specific purpose due to potential data loss. With windows-1251 encoding, all bytes can be successfully recovered. In any case, all instances of CR and CR+LF characters are replaced with LF characters. As a result, additional data needs to be incorporated into the page to restore these characters. This task is accomplished by the `<sfz-extra-data>` tag, which contains both the necessary data and the offset specifying the start of the ZIP payload encoded in base64.