每当我使用默认设置打开 LibreOffice 保存的 ODT 文件,并在纯文本编辑器中打开它时,我都会得到一堆无用的内容。我输入的文本没有一丝痕迹。
ODT 采用什么字符编码?
答案1
ODT 文件是包含多个文件的压缩档案 (zip 文件)。如果您解压缩 (unzip) 它,您将找到其内容。
$ unzip foo.odt
Archive: foo.odt
extracting: mimetype
inflating: Pictures/2000006A00000BF2000000FE05FAFF99.svm
inflating: Pictures/200000B200000BFC000002A0046833A0.svm
inflating: Pictures/200000EA00000F69000002A0332EA603.svm
inflating: Pictures/2000006200000AA500000136B263D3BB.svm
inflating: Pictures/2000006A00000AD2000001917B356A9B.svm
inflating: Pictures/2000005A00000A5A0000017F19B0D1EE.svm
inflating: Pictures/2000009200001036000001309FA6D695.svm
inflating: Pictures/2000008E00001C330000034F3E642D92.svm
inflating: Pictures/20000092000011AD0000014269F7C132.svm
inflating: Pictures/200000890000107E000002A0D7E80C67.svm
inflating: Pictures/200000E200001295000002A0E7D552DC.svm
inflating: Pictures/200000B2000012AB000001712E0D7F4B.svm
inflating: Pictures/200000CF00001D390000034F15D09B76.svm
inflating: Pictures/2000013A000019BA0000042370CD253A.svm
inflating: Pictures/2000007A00000C6300000136B0155364.svm
inflating: meta.xml
inflating: settings.xml
inflating: content.xml
extracting: Thumbnails/thumbnail.png
inflating: layout-cache
inflating: manifest.rdf
creating: Configurations2/images/Bitmaps/
creating: Configurations2/popupmenu/
creating: Configurations2/toolpanel/
creating: Configurations2/statusbar/
creating: Configurations2/progressbar/
creating: Configurations2/toolbar/
creating: Configurations2/floater/
creating: Configurations2/menubar/
inflating: Configurations2/accelerator/current.xml
inflating: styles.xml
inflating: META-INF/manifest.xml
因此,当您尝试在文本编辑器中打开它时,它将显示为二进制数据,因为它不包含编码文本!