[分享] 解壓縮zip檔,產生亂碼,如何解決的心得 [論壇 - Ubuntu 與工具程式及軟體推薦]
正在瀏覽:
1 名遊客
回覆: [分享] 解壓縮zip檔,產生亂碼,如何解決的心得 |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
版主
![]() ![]() 註冊日期:
2008/7/14 0:03 來自 螢幕的另一端
所屬群組:
網站管理員 已註冊使用者 討論區管理群 等級: 33
HP : 0 / 808
![]() |
samwhelp 寫到: 我參照你提供的連結「shell script」改寫了個小程式,搭配 caja-actions (或你也可以搭配 nautilus-actions) caja-actions 裡的設定 新增一個 New Action==>右邊的Action頁面==>Context label:填入:"7z中文解壓"==>右邊的Command頁面== Path:填入 /home/user/scripts/7zch.sh ==>Parameters:填入 %b %w ==>按 Ctrl+s 存檔離開。 說明:這裡%b 代表 basename(純檔案名稱) 而 %w 代表去除副檔名的檔案名稱 7zch.sh 內容 =========================== #!/bin/bash #說明: 解決big5中文檔名解壓後檔名亂碼的問題 #需求套件:需安裝 7z 和 convmv file=$1 path=$2 mkdir -p $path LANG=zh_TW.BIG-5 7z e -y -o"$path" "$file" 2>/dev/null (cd "$path" && convmv -f BIG5 -t UTF-8 --notest --replace * ) =========================== 我上面的程式碼修改後,就不限定只能解壓 zip 檔, 其它凡是7z有支援解壓縮的格式都可以。 問題是,限制只能處理 big5 的中文檔名,無法自動判斷gb2312 or gbk 簡體中文,若能夠做到自動判斷編碼的話,那麼這個程式就完美的解決了中文檔名亂碼的問題了。
2014/10/13 17:23
|
||||||||||
![]() |
回覆: [分享] 解壓縮zip檔,產生亂碼,如何解決的心得 |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員五級
![]() ![]() 註冊日期:
2012/4/22 10:50 所屬群組:
已註冊使用者 等級: 36
HP : 0 / 898
![]() |
看到了這篇「討論」的其中一個回覆,
提到了兩個指令,「lsar」和「unar」。 做了一些研究,紀錄如下: 以下是在「Ubuntu 18.04」的環境下測試。 ================================================================================ ## 查詢相關套件 幾個參考指令如下
可以找到套件「unar」。 ================================================================================ ## 安裝
================================================================================ ## 相關檔案 執行
顯示
執行
顯示
## Manpage * $ man lsar * $ man unar ================================================================================ ## 操作範例檔案 一樣用「#1」提到的範例檔案來做測試 執行下面指令下載
會下載一個檔案「Open_Data.zip」。 ================================================================================ ## 指令範例 - 基本操作 ================================================================================ ### 觀看 Open_Data.zip 執行
顯示 Open_Data.zip: Zip Open_Data/ Open_Data/Fonts/ Open_Data/Fonts/png_24x24.zip Open_Data/Fonts/TW-Kai-98_1.ttf Open_Data/Fonts/TW-Kai-Ext-B-98_1.ttf Open_Data/Fonts/TW-Kai-Plus-98_1.ttf Open_Data/Fonts/TW-Sung-98_1.ttf Open_Data/Fonts/TW-Sung-Ext-B-98_1.ttf Open_Data/Fonts/TW-Sung-Plus-98_1.ttf Open_Data/Fonts/全字庫字型說明文件.txt Open_Data/MapingTables/ Open_Data/MapingTables/Big5/ Open_Data/MapingTables/Big5/CNS2BIG5.txt Open_Data/MapingTables/Big5/CNS2BIG5_Big5E.txt Open_Data/MapingTables/Big5/CNS2BIG5_七個倚天外字.txt Open_Data/MapingTables/Big5/CNS2BIG5_符號.txt Open_Data/MapingTables/CNS2DCI.txt Open_Data/MapingTables/CNS2FIN.txt Open_Data/MapingTables/CNS2INC.txt Open_Data/MapingTables/CNS2TAX.txt Open_Data/MapingTables/Unicode/ Open_Data/MapingTables/Unicode/CNS2UNICODE_Unicode 15.txt Open_Data/MapingTables/Unicode/CNS2UNICODE_Unicode 2.txt Open_Data/MapingTables/Unicode/CNS2UNICODE_Unicode BMP.txt Open_Data/MapingTables/全字庫中文對照表說明文件.txt Open_Data/MapingTables/地政/ Open_Data/MapingTables/地政/南投縣.txt Open_Data/MapingTables/地政/台中市.txt Open_Data/MapingTables/地政/台中縣.txt Open_Data/MapingTables/地政/台北市.txt Open_Data/MapingTables/地政/台北縣.txt Open_Data/MapingTables/地政/台南市.txt Open_Data/MapingTables/地政/台南縣.txt Open_Data/MapingTables/地政/台東縣.txt Open_Data/MapingTables/地政/嘉義市.txt Open_Data/MapingTables/地政/嘉義縣.txt Open_Data/MapingTables/地政/基隆市.txt Open_Data/MapingTables/地政/宜蘭縣.txt Open_Data/MapingTables/地政/屏東縣.txt Open_Data/MapingTables/地政/彰化縣.txt Open_Data/MapingTables/地政/新竹市.txt Open_Data/MapingTables/地政/新竹縣.txt Open_Data/MapingTables/地政/桃園縣.txt Open_Data/MapingTables/地政/澎湖縣.txt Open_Data/MapingTables/地政/花蓮縣.txt Open_Data/MapingTables/地政/苗栗縣.txt Open_Data/MapingTables/地政/連江縣.txt Open_Data/MapingTables/地政/金門縣.txt Open_Data/MapingTables/地政/雲林縣.txt Open_Data/MapingTables/地政/高雄市.txt Open_Data/MapingTables/地政/高雄縣.txt Open_Data/Properties/ Open_Data/Properties/CNS_cangjie.txt Open_Data/Properties/CNS_component.txt Open_Data/Properties/CNS_component_word.txt Open_Data/Properties/CNS_component_word.zip Open_Data/Properties/CNS_phonetic.txt Open_Data/Properties/CNS_pinyin.txt Open_Data/Properties/CNS_radical.txt Open_Data/Properties/CNS_radical_word.txt Open_Data/Properties/CNS_stroke.txt Open_Data/Properties/CNS_strokes_sequence.txt Open_Data/Properties/全字庫屬性資料說明文件.txt Open_Data/資料更新說明.txt ================================================================================ ### 解開 「Open_Data.zip」 執行
顯示 Open_Data.zip: Zip Open_Data/ (dir)... OK. Open_Data/Fonts/ (dir)... OK. Open_Data/Fonts/png_24x24.zip (130052362 B)... OK. Open_Data/Fonts/TW-Kai-98_1.ttf (52424436 B)... OK. Open_Data/Fonts/TW-Kai-Ext-B-98_1.ttf (65114368 B)... OK. Open_Data/Fonts/TW-Kai-Plus-98_1.ttf (33131548 B)... OK. Open_Data/Fonts/TW-Sung-98_1.ttf (35743060 B)... OK. Open_Data/Fonts/TW-Sung-Ext-B-98_1.ttf (67100540 B)... OK. Open_Data/Fonts/TW-Sung-Plus-98_1.ttf (29473908 B)... OK. Open_Data/Fonts/全字庫字型說明文件.txt (632 B)... OK. Open_Data/MapingTables/ (dir)... OK. Open_Data/MapingTables/Big5/ (dir)... OK. Open_Data/MapingTables/Big5/CNS2BIG5.txt (156611 B)... OK. Open_Data/MapingTables/Big5/CNS2BIG5_Big5E.txt (47447 B)... OK. Open_Data/MapingTables/Big5/CNS2BIG5_七個倚天外字.txt (83 B)... OK. Open_Data/MapingTables/Big5/CNS2BIG5_符號.txt (5303 B)... OK. Open_Data/MapingTables/CNS2DCI.txt (196288 B)... OK. Open_Data/MapingTables/CNS2FIN.txt (261769 B)... OK. Open_Data/MapingTables/CNS2INC.txt (63837 B)... OK. Open_Data/MapingTables/CNS2TAX.txt (261553 B)... OK. Open_Data/MapingTables/Unicode/ (dir)... OK. Open_Data/MapingTables/Unicode/CNS2UNICODE_Unicode 15.txt (280284 B)... OK. Open_Data/MapingTables/Unicode/CNS2UNICODE_Unicode 2.txt (658838 B)... OK. Open_Data/MapingTables/Unicode/CNS2UNICODE_Unicode BMP.txt (473203 B)... OK. Open_Data/MapingTables/全字庫中文對照表說明文件.txt (2656 B)... OK. Open_Data/MapingTables/地政/ (dir)... OK. Open_Data/MapingTables/地政/南投縣.txt (19019 B)... OK. Open_Data/MapingTables/地政/台中市.txt (20296 B)... OK. Open_Data/MapingTables/地政/台中縣.txt (20660 B)... OK. Open_Data/MapingTables/地政/台北市.txt (51904 B)... OK. Open_Data/MapingTables/地政/台北縣.txt (51836 B)... OK. Open_Data/MapingTables/地政/台南市.txt (15253 B)... OK. Open_Data/MapingTables/地政/台南縣.txt (36507 B)... OK. Open_Data/MapingTables/地政/台東縣.txt (22447 B)... OK. Open_Data/MapingTables/地政/嘉義市.txt (9163 B)... OK. Open_Data/MapingTables/地政/嘉義縣.txt (26655 B)... OK. Open_Data/MapingTables/地政/基隆市.txt (6544 B)... OK. Open_Data/MapingTables/地政/宜蘭縣.txt (39068 B)... OK. Open_Data/MapingTables/地政/屏東縣.txt (26638 B)... OK. Open_Data/MapingTables/地政/彰化縣.txt (33564 B)... OK. Open_Data/MapingTables/地政/新竹市.txt (4546 B)... OK. Open_Data/MapingTables/地政/新竹縣.txt (3514 B)... OK. Open_Data/MapingTables/地政/桃園縣.txt (22223 B)... OK. Open_Data/MapingTables/地政/澎湖縣.txt (26779 B)... OK. Open_Data/MapingTables/地政/花蓮縣.txt (816 B)... OK. Open_Data/MapingTables/地政/苗栗縣.txt (6588 B)... OK. Open_Data/MapingTables/地政/連江縣.txt (330 B)... OK. Open_Data/MapingTables/地政/金門縣.txt (4018 B)... OK. Open_Data/MapingTables/地政/雲林縣.txt (34584 B)... OK. Open_Data/MapingTables/地政/高雄市.txt (17958 B)... OK. Open_Data/MapingTables/地政/高雄縣.txt (32893 B)... OK. Open_Data/Properties/ (dir)... OK. Open_Data/Properties/CNS_cangjie.txt (1324233 B)... OK. Open_Data/Properties/CNS_component.txt (2074497 B)... OK. Open_Data/Properties/CNS_component_word.txt (4950 B)... OK. Open_Data/Properties/CNS_component_word.zip (349210 B)... OK. Open_Data/Properties/CNS_phonetic.txt (1934752 B)... OK. Open_Data/Properties/CNS_pinyin.txt (48009 B)... OK. Open_Data/Properties/CNS_radical.txt (1058104 B)... OK. Open_Data/Properties/CNS_radical_word.txt (2199 B)... OK. Open_Data/Properties/CNS_stroke.txt (996851 B)... OK. Open_Data/Properties/CNS_strokes_sequence.txt (2125144 B)... OK. Open_Data/Properties/全字庫屬性資料說明文件.txt (3523 B)... OK. Open_Data/資料更新說明.txt (1447 B)... OK. Successfully extracted to "./Open_Data". ================================================================================ ## 指令範例 - 其他操作 ================================================================================ ### 顯示編碼 執行
顯示
稍微看了一下「unar」的原始碼,是使用「Objective-C」寫成的, 偵測編碼的部份是「C++」, 之前在「#4」裡面的「jserv這篇文章」有提到 一些相關的專案也有使用到 * https://github.com/Joungkyun/libchardet (Package: libchardet-dev) (HOME) * https://github.com/BYVoid/uchardet (Package: libuchardet-dev) (HOME) ================================================================================ 執行
顯示 Open_Data.zip: Zip Flags File size Ratio Mode Date Time Name ===== ========== ===== ==== ========== ===== ==== 0. D---- 0 ----- None 2016-12-06 15:54 Open_Data/ 1. D---- 0 ----- None 2016-12-06 17:53 Open_Data/Fonts/ 2. ----- 130052362 24.1% Defl 2018-08-30 19:59 Open_Data/Fonts/png_24x24.zip 3. ----- 52424436 50.9% Defl 2018-08-10 09:33 Open_Data/Fonts/TW-Kai-98_1.ttf 4. ----- 65114368 47.3% Defl 2018-08-03 16:41 Open_Data/Fonts/TW-Kai-Ext-B-98_1.ttf 5. ----- 33131548 49.7% Defl 2018-08-30 19:56 Open_Data/Fonts/TW-Kai-Plus-98_1.ttf 6. ----- 35743060 50.6% Defl 2018-08-10 09:32 Open_Data/Fonts/TW-Sung-98_1.ttf 7. ----- 67100540 48.2% Defl 2018-08-02 18:10 Open_Data/Fonts/TW-Sung-Ext-B-98_1.ttf 8. ----- 29473908 49.0% Defl 2018-08-30 19:57 Open_Data/Fonts/TW-Sung-Plus-98_1.ttf 9. ----- 632 63.9% Defl 2017-10-16 15:32 Open_Data/Fonts/全字庫字型說明文件.txt 10. D---- 0 ----- None 2018-07-31 19:24 Open_Data/MapingTables/ 11. D---- 0 ----- None 2018-08-03 16:52 Open_Data/MapingTables/Big5/ 12. ----- 156611 77.9% Defl 2018-08-02 19:37 Open_Data/MapingTables/Big5/CNS2BIG5.txt 13. ----- 47447 76.1% Defl 2018-08-02 19:37 Open_Data/MapingTables/Big5/CNS2BIG5_Big5E.txt 14. ----- 83 32.5% Defl 2018-08-02 19:37 Open_Data/MapingTables/Big5/CNS2BIG5_七個倚天外字.txt 15. ----- 5303 76.7% Defl 2018-08-02 19:37 Open_Data/MapingTables/Big5/CNS2BIG5_符號.txt 16. ----- 196288 70.3% Defl 2018-08-03 17:29 Open_Data/MapingTables/CNS2DCI.txt 17. ----- 261769 74.3% Defl 2018-08-03 17:42 Open_Data/MapingTables/CNS2FIN.txt 18. ----- 63837 67.2% Defl 2018-08-03 17:47 Open_Data/MapingTables/CNS2INC.txt 19. ----- 261553 69.5% Defl 2018-08-03 18:00 Open_Data/MapingTables/CNS2TAX.txt 20. D---- 0 ----- None 2018-08-03 16:52 Open_Data/MapingTables/Unicode/ 21. ----- 280284 80.3% Defl 2018-08-30 20:42 Open_Data/MapingTables/Unicode/CNS2UNICODE_Unicode 15.txt 22. ----- 658838 75.9% Defl 2018-08-30 20:42 Open_Data/MapingTables/Unicode/CNS2UNICODE_Unicode 2.txt 23. ----- 473203 73.0% Defl 2018-08-30 20:41 Open_Data/MapingTables/Unicode/CNS2UNICODE_Unicode BMP.txt 24. ----- 2656 80.4% Defl 2018-08-03 18:11 Open_Data/MapingTables/全字庫中文對照表說明文件.txt 25. D---- 0 ----- None 2018-08-03 16:52 Open_Data/MapingTables/地政/ 26. ----- 19019 63.9% Defl 2018-08-03 18:45 Open_Data/MapingTables/地政/南投縣.txt 27. ----- 20296 63.2% Defl 2018-08-03 18:14 Open_Data/MapingTables/地政/台中市.txt 28. ----- 20660 63.0% Defl 2018-08-03 18:16 Open_Data/MapingTables/地政/台中縣.txt 29. ----- 51904 63.9% Defl 2018-08-03 18:39 Open_Data/MapingTables/地政/台北市.txt 30. ----- 51836 64.0% Defl 2018-08-03 18:35 Open_Data/MapingTables/地政/台北縣.txt 31. ----- 15253 63.1% Defl 2018-08-03 18:38 Open_Data/MapingTables/地政/台南市.txt 32. ----- 36507 63.2% Defl 2018-08-03 18:39 Open_Data/MapingTables/地政/台南縣.txt 33. ----- 22447 63.9% Defl 2018-08-03 18:36 Open_Data/MapingTables/地政/台東縣.txt 34. ----- 9163 62.8% Defl 2018-08-03 18:59 Open_Data/MapingTables/地政/嘉義市.txt 35. ----- 26655 63.3% Defl 2018-08-03 19:01 Open_Data/MapingTables/地政/嘉義縣.txt 36. ----- 6544 63.3% Defl 2018-08-03 18:54 Open_Data/MapingTables/地政/基隆市.txt 37. ----- 39068 65.8% Defl 2018-08-03 18:41 Open_Data/MapingTables/地政/宜蘭縣.txt 38. ----- 26638 63.5% Defl 2018-08-03 18:46 Open_Data/MapingTables/地政/屏東縣.txt 39. ----- 33564 64.4% Defl 2018-08-03 19:02 Open_Data/MapingTables/地政/彰化縣.txt 40. ----- 4546 62.3% Defl 2018-08-03 18:57 Open_Data/MapingTables/地政/新竹市.txt 41. ----- 3514 61.2% Defl 2018-08-03 18:58 Open_Data/MapingTables/地政/新竹縣.txt 42. ----- 22223 63.1% Defl 2018-08-03 18:49 Open_Data/MapingTables/地政/桃園縣.txt 43. ----- 26779 63.3% Defl 2018-08-03 19:04 Open_Data/MapingTables/地政/澎湖縣.txt 44. ----- 816 54.9% Defl 2018-08-03 18:42 Open_Data/MapingTables/地政/花蓮縣.txt 45. ----- 6588 61.7% Defl 2018-08-03 18:47 Open_Data/MapingTables/地政/苗栗縣.txt 46. ----- 330 56.4% Defl 2018-08-03 18:55 Open_Data/MapingTables/地政/連江縣.txt 47. ----- 4018 62.6% Defl 2018-08-03 18:43 Open_Data/MapingTables/地政/金門縣.txt 48. ----- 34584 63.2% Defl 2018-08-03 18:56 Open_Data/MapingTables/地政/雲林縣.txt 49. ----- 17958 62.5% Defl 2018-08-03 18:50 Open_Data/MapingTables/地政/高雄市.txt 50. ----- 32893 63.9% Defl 2018-08-03 18:52 Open_Data/MapingTables/地政/高雄縣.txt 51. D---- 0 ----- None 2018-08-17 14:31 Open_Data/Properties/ 52. ----- 1324233 66.4% Defl 2018-08-30 20:39 Open_Data/Properties/CNS_cangjie.txt 53. ----- 2074497 71.8% Defl 2018-08-30 20:38 Open_Data/Properties/CNS_component.txt 54. ----- 4950 70.2% Defl 2017-10-16 15:29 Open_Data/Properties/CNS_component_word.txt 55. ----- 349210 15.2% Defl 2016-06-27 16:59 Open_Data/Properties/CNS_component_word.zip 56. ----- 1934752 78.1% Defl 2018-08-30 20:37 Open_Data/Properties/CNS_phonetic.txt 57. ----- 48009 73.7% Defl 2018-07-31 17:52 Open_Data/Properties/CNS_pinyin.txt 58. ----- 1058104 82.2% Defl 2018-08-30 20:37 Open_Data/Properties/CNS_radical.txt 59. ----- 2199 49.9% Defl 2018-07-31 17:52 Open_Data/Properties/CNS_radical_word.txt 60. ----- 996851 84.6% Defl 2018-08-30 20:35 Open_Data/Properties/CNS_stroke.txt 61. ----- 2125144 74.6% Defl 2018-08-30 20:39 Open_Data/Properties/CNS_strokes_sequence.txt 62. ----- 3523 76.0% Defl 2018-08-02 17:57 Open_Data/Properties/全字庫屬性資料說明文件.txt 63. ----- 1447 61.6% Defl 2018-08-31 10:37 Open_Data/資料更新說明.txt (Flags: D=Directory, R=Resource fork, L=Link, E=Encrypted, @=Extended attributes) (Mode: Defl=Deflate) ================================================================================ 執行
顯示 { "lsarFormatVersion": 2, "lsarContents": [ { "ZipLocalDate": 1233551052, "ZipCRC32": 0, "XADFileName": "Open_Data", "XADCompressionName": "None", "ZipExtractVersion": 10, "ZipFlags": 0, "ZipFileAttributes": 16, "ZipCompressionMethod": 0, "XADDataLength": 0, "XADIsDirectory": 1, "ZipOSName": "MS-DOS", "XADDataOffset": 40, "XADLastModificationDate": "2016-12-06 15:54:24 +0800", "XADDOSFileAttributes": 16, "ZipOS": 0, "XADFileSize": 0, "XADCompressedSize": 0, "XADIndex": 0 }, { "ZipLocalDate": 1233555122, "ZipCRC32": 0, "XADFileName": "Open_Data/Fonts", "XADCompressionName": "None", "ZipExtractVersion": 10, "ZipFlags": 0, "ZipFileAttributes": 16, "ZipCompressionMethod": 0, "XADDataLength": 0, "XADIsDirectory": 1, "ZipOSName": "MS-DOS", "XADDataOffset": 86, "XADLastModificationDate": "2016-12-06 17:53:36 +0800", "XADDOSFileAttributes": 16, "ZipOS": 0, "XADFileSize": 0, "XADCompressedSize": 0, "XADIndex": 1 }, { "ZipLocalDate": 1293852525, "ZipCRC32": 3115747644, "XADFileName": "Open_Data/Fonts/png_24x24.zip", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 98689273, "ZipOSName": "MS-DOS", "XADDataOffset": 145, "XADLastModificationDate": "2018-08-30 19:59:26 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 130052362, "XADCompressedSize": 98689273, "XADIndex": 2 }, { "ZipLocalDate": 1292520509, "ZipCRC32": 3795005353, "XADFileName": "Open_Data/Fonts/TW-Kai-98_1.ttf", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 25745537, "ZipOSName": "MS-DOS", "XADDataOffset": 98689479, "XADLastModificationDate": "2018-08-10 09:33:58 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 52424436, "XADCompressedSize": 25745537, "XADIndex": 3 }, { "ZipLocalDate": 1292076342, "ZipCRC32": 3476985660, "XADFileName": "Open_Data/Fonts/TW-Kai-Ext-B-98_1.ttf", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 34299445, "ZipOSName": "MS-DOS", "XADDataOffset": 124435083, "XADLastModificationDate": "2018-08-03 16:41:44 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 65114368, "XADCompressedSize": 34299445, "XADIndex": 4 }, { "ZipLocalDate": 1293852440, "ZipCRC32": 880599720, "XADFileName": "Open_Data/Fonts/TW-Kai-Plus-98_1.ttf", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 16667992, "ZipOSName": "MS-DOS", "XADDataOffset": 158734594, "XADLastModificationDate": "2018-08-30 19:56:48 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 33131548, "XADCompressedSize": 16667992, "XADIndex": 5 }, { "ZipLocalDate": 1292520452, "ZipCRC32": 2961500822, "XADFileName": "Open_Data/Fonts/TW-Sung-98_1.ttf", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 17667075, "ZipOSName": "MS-DOS", "XADDataOffset": 175402648, "XADLastModificationDate": "2018-08-10 09:32:08 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 35743060, "XADCompressedSize": 17667075, "XADIndex": 6 }, { "ZipLocalDate": 1292013900, "ZipCRC32": 398516359, "XADFileName": "Open_Data/Fonts/TW-Sung-Ext-B-98_1.ttf", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 34736458, "ZipOSName": "MS-DOS", "XADDataOffset": 193069791, "XADLastModificationDate": "2018-08-02 18:10:24 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 67100540, "XADCompressedSize": 34736458, "XADIndex": 7 }, { "ZipLocalDate": 1293852477, "ZipCRC32": 988150552, "XADFileName": "Open_Data/Fonts/TW-Sung-Plus-98_1.ttf", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 15030063, "ZipOSName": "MS-DOS", "XADDataOffset": 227806316, "XADLastModificationDate": "2018-08-30 19:57:58 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 29473908, "XADCompressedSize": 15030063, "XADIndex": 8 }, { "ZipLocalDate": 1263565851, "ZipCRC32": 1854489340, "XADFileName": "Open_Data/Fonts/全字庫字型說明文件.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 228, "ZipOSName": "MS-DOS", "XADDataOffset": 242836503, "XADLastModificationDate": "2017-10-16 15:32:54 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 632, "XADCompressedSize": 228, "XADIndex": 9 }, { "ZipLocalDate": 1291819794, "ZipCRC32": 0, "XADFileName": "Open_Data/MapingTables", "XADCompressionName": "None", "ZipExtractVersion": 10, "ZipFlags": 0, "ZipFileAttributes": 16, "ZipCompressionMethod": 0, "XADDataLength": 0, "XADIsDirectory": 1, "ZipOSName": "MS-DOS", "XADDataOffset": 242836784, "XADLastModificationDate": "2018-07-31 19:24:36 +0800", "XADDOSFileAttributes": 16, "ZipOS": 0, "XADFileSize": 0, "XADCompressedSize": 0, "XADIndex": 10 }, { "ZipLocalDate": 1292076683, "ZipCRC32": 0, "XADFileName": "Open_Data/MapingTables/Big5", "XADCompressionName": "None", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 16, "ZipCompressionMethod": 0, "XADDataLength": 0, "XADIsDirectory": 1, "ZipOSName": "MS-DOS", "XADDataOffset": 242836842, "XADLastModificationDate": "2018-08-03 16:52:22 +0800", "XADDOSFileAttributes": 16, "ZipOS": 0, "XADFileSize": 0, "XADCompressedSize": 0, "XADIndex": 11 }, { "ZipLocalDate": 1292016825, "ZipCRC32": 1107592894, "XADFileName": "Open_Data/MapingTables/Big5/CNS2BIG5.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 34637, "ZipOSName": "MS-DOS", "XADDataOffset": 242836912, "XADLastModificationDate": "2018-08-02 19:37:50 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 156611, "XADCompressedSize": 34637, "XADIndex": 12 }, { "ZipLocalDate": 1292016823, "ZipCRC32": 3814405290, "XADFileName": "Open_Data/MapingTables/Big5/CNS2BIG5_Big5E.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 11326, "ZipOSName": "MS-DOS", "XADDataOffset": 242871625, "XADLastModificationDate": "2018-08-02 19:37:46 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 47447, "XADCompressedSize": 11326, "XADIndex": 13 }, { "ZipLocalDate": 1292016822, "ZipCRC32": 2452914879, "XADFileName": "Open_Data/MapingTables/Big5/CNS2BIG5_七個倚天外字.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 56, "ZipOSName": "MS-DOS", "XADDataOffset": 242883034, "XADLastModificationDate": "2018-08-02 19:37:44 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 83, "XADCompressedSize": 56, "XADIndex": 14 }, { "ZipLocalDate": 1292016820, "ZipCRC32": 2836740456, "XADFileName": "Open_Data/MapingTables/Big5/CNS2BIG5_符號.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 1235, "ZipOSName": "MS-DOS", "XADDataOffset": 242883165, "XADLastModificationDate": "2018-08-02 19:37:40 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 5303, "XADCompressedSize": 1235, "XADIndex": 15 }, { "ZipLocalDate": 1292078012, "ZipCRC32": 2967502303, "XADFileName": "Open_Data/MapingTables/CNS2DCI.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 58250, "ZipOSName": "MS-DOS", "XADDataOffset": 242884464, "XADLastModificationDate": "2018-08-03 17:29:56 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 196288, "XADCompressedSize": 58250, "XADIndex": 16 }, { "ZipLocalDate": 1292078414, "ZipCRC32": 121423451, "XADFileName": "Open_Data/MapingTables/CNS2FIN.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 67311, "ZipOSName": "MS-DOS", "XADDataOffset": 242942778, "XADLastModificationDate": "2018-08-03 17:42:28 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 261769, "XADCompressedSize": 67311, "XADIndex": 17 }, { "ZipLocalDate": 1292078566, "ZipCRC32": 3030471824, "XADFileName": "Open_Data/MapingTables/CNS2INC.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 20924, "ZipOSName": "MS-DOS", "XADDataOffset": 243010153, "XADLastModificationDate": "2018-08-03 17:47:12 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 63837, "XADCompressedSize": 20924, "XADIndex": 18 }, { "ZipLocalDate": 1292079118, "ZipCRC32": 2905145995, "XADFileName": "Open_Data/MapingTables/CNS2TAX.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 79861, "ZipOSName": "MS-DOS", "XADDataOffset": 243031141, "XADLastModificationDate": "2018-08-03 18:00:28 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 261553, "XADCompressedSize": 79861, "XADIndex": 19 }, { "ZipLocalDate": 1292076683, "ZipCRC32": 0, "XADFileName": "Open_Data/MapingTables/Unicode", "XADCompressionName": "None", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 16, "ZipCompressionMethod": 0, "XADDataLength": 0, "XADIsDirectory": 1, "ZipOSName": "MS-DOS", "XADDataOffset": 243111063, "XADLastModificationDate": "2018-08-03 16:52:22 +0800", "XADDOSFileAttributes": 16, "ZipOS": 0, "XADFileSize": 0, "XADCompressedSize": 0, "XADIndex": 20 }, { "ZipLocalDate": 1293854035, "ZipCRC32": 1525272481, "XADFileName": "Open_Data/MapingTables/Unicode/CNS2UNICODE_Unicode 15.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 55306, "ZipOSName": "MS-DOS", "XADDataOffset": 243111150, "XADLastModificationDate": "2018-08-30 20:42:38 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 280284, "XADCompressedSize": 55306, "XADIndex": 21 }, { "ZipLocalDate": 1293854017, "ZipCRC32": 1088409148, "XADFileName": "Open_Data/MapingTables/Unicode/CNS2UNICODE_Unicode 2.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 158907, "ZipOSName": "MS-DOS", "XADDataOffset": 243166542, "XADLastModificationDate": "2018-08-30 20:42:02 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 658838, "XADCompressedSize": 158907, "XADIndex": 22 }, { "ZipLocalDate": 1293853989, "ZipCRC32": 1207727997, "XADFileName": "Open_Data/MapingTables/Unicode/CNS2UNICODE_Unicode BMP.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 127994, "ZipOSName": "MS-DOS", "XADDataOffset": 243325537, "XADLastModificationDate": "2018-08-30 20:41:10 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 473203, "XADCompressedSize": 127994, "XADIndex": 23 }, { "ZipLocalDate": 1292079480, "ZipCRC32": 2163100181, "XADFileName": "Open_Data/MapingTables/全字庫中文對照表說明文件.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 520, "ZipOSName": "MS-DOS", "XADDataOffset": 243453612, "XADLastModificationDate": "2018-08-03 18:11:48 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 2656, "XADCompressedSize": 520, "XADIndex": 24 }, { "ZipLocalDate": 1292076683, "ZipCRC32": 0, "XADFileName": "Open_Data/MapingTables/地政", "XADCompressionName": "None", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 16, "ZipCompressionMethod": 0, "XADDataLength": 0, "XADIsDirectory": 1, "ZipOSName": "MS-DOS", "XADDataOffset": 243454190, "XADLastModificationDate": "2018-08-03 16:52:22 +0800", "XADDOSFileAttributes": 16, "ZipOS": 0, "XADFileSize": 0, "XADCompressedSize": 0, "XADIndex": 25 }, { "ZipLocalDate": 1292080551, "ZipCRC32": 1179643482, "XADFileName": "Open_Data/MapingTables/地政/南投縣.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 6868, "ZipOSName": "MS-DOS", "XADDataOffset": 243454258, "XADLastModificationDate": "2018-08-03 18:45:14 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 19019, "XADCompressedSize": 6868, "XADIndex": 26 }, { "ZipLocalDate": 1292079581, "ZipCRC32": 190817749, "XADFileName": "Open_Data/MapingTables/地政/台中市.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 7471, "ZipOSName": "MS-DOS", "XADDataOffset": 243461194, "XADLastModificationDate": "2018-08-03 18:14:58 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 20296, "XADCompressedSize": 7471, "XADIndex": 27 }, { "ZipLocalDate": 1292079634, "ZipCRC32": 3799907673, "XADFileName": "Open_Data/MapingTables/地政/台中縣.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 7646, "ZipOSName": "MS-DOS", "XADDataOffset": 243468733, "XADLastModificationDate": "2018-08-03 18:16:36 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 20660, "XADCompressedSize": 7646, "XADIndex": 28 }, { "ZipLocalDate": 1292080380, "ZipCRC32": 3559015331, "XADFileName": "Open_Data/MapingTables/地政/台北市.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 18759, "ZipOSName": "MS-DOS", "XADDataOffset": 243476447, "XADLastModificationDate": "2018-08-03 18:39:56 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 51904, "XADCompressedSize": 18759, "XADIndex": 29 }, { "ZipLocalDate": 1292080234, "ZipCRC32": 4140696105, "XADFileName": "Open_Data/MapingTables/地政/台北縣.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 18636, "ZipOSName": "MS-DOS", "XADDataOffset": 243495274, "XADLastModificationDate": "2018-08-03 18:35:20 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 51836, "XADCompressedSize": 18636, "XADIndex": 30 }, { "ZipLocalDate": 1292080323, "ZipCRC32": 26321253, "XADFileName": "Open_Data/MapingTables/地政/台南市.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 5632, "ZipOSName": "MS-DOS", "XADDataOffset": 243513978, "XADLastModificationDate": "2018-08-03 18:38:06 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 15253, "XADCompressedSize": 5632, "XADIndex": 31 }, { "ZipLocalDate": 1292080360, "ZipCRC32": 3787455137, "XADFileName": "Open_Data/MapingTables/地政/台南縣.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 13446, "ZipOSName": "MS-DOS", "XADDataOffset": 243519678, "XADLastModificationDate": "2018-08-03 18:39:16 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 36507, "XADCompressedSize": 13446, "XADIndex": 32 }, { "ZipLocalDate": 1292080278, "ZipCRC32": 2601429627, "XADFileName": "Open_Data/MapingTables/地政/台東縣.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 8105, "ZipOSName": "MS-DOS", "XADDataOffset": 243533192, "XADLastModificationDate": "2018-08-03 18:36:44 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 22447, "XADCompressedSize": 8105, "XADIndex": 33 }, { "ZipLocalDate": 1292081014, "ZipCRC32": 2360113961, "XADFileName": "Open_Data/MapingTables/地政/嘉義市.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 3405, "ZipOSName": "MS-DOS", "XADDataOffset": 243541365, "XADLastModificationDate": "2018-08-03 18:59:44 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 9163, "XADCompressedSize": 3405, "XADIndex": 34 }, { "ZipLocalDate": 1292081197, "ZipCRC32": 3636273407, "XADFileName": "Open_Data/MapingTables/地政/嘉義縣.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 9793, "ZipOSName": "MS-DOS", "XADDataOffset": 243544838, "XADLastModificationDate": "2018-08-03 19:01:26 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 26655, "XADCompressedSize": 9793, "XADIndex": 35 }, { "ZipLocalDate": 1292080833, "ZipCRC32": 4032955980, "XADFileName": "Open_Data/MapingTables/地政/基隆市.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 2402, "ZipOSName": "MS-DOS", "XADDataOffset": 243554699, "XADLastModificationDate": "2018-08-03 18:54:02 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 6544, "XADCompressedSize": 2402, "XADIndex": 36 }, { "ZipLocalDate": 1292080431, "ZipCRC32": 4193464727, "XADFileName": "Open_Data/MapingTables/地政/宜蘭縣.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 13368, "ZipOSName": "MS-DOS", "XADDataOffset": 243557169, "XADLastModificationDate": "2018-08-03 18:41:30 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 39068, "XADCompressedSize": 13368, "XADIndex": 37 }, { "ZipLocalDate": 1292080595, "ZipCRC32": 2577096907, "XADFileName": "Open_Data/MapingTables/地政/屏東縣.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 9711, "ZipOSName": "MS-DOS", "XADDataOffset": 243570605, "XADLastModificationDate": "2018-08-03 18:46:38 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 26638, "XADCompressedSize": 9711, "XADIndex": 38 }, { "ZipLocalDate": 1292081242, "ZipCRC32": 333131845, "XADFileName": "Open_Data/MapingTables/地政/彰化縣.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 11957, "ZipOSName": "MS-DOS", "XADDataOffset": 243580384, "XADLastModificationDate": "2018-08-03 19:02:52 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 33564, "XADCompressedSize": 11957, "XADIndex": 39 }, { "ZipLocalDate": 1292080944, "ZipCRC32": 1664003830, "XADFileName": "Open_Data/MapingTables/地政/新竹市.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 1716, "ZipOSName": "MS-DOS", "XADDataOffset": 243592409, "XADLastModificationDate": "2018-08-03 18:57:32 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 4546, "XADCompressedSize": 1716, "XADIndex": 40 }, { "ZipLocalDate": 1292080977, "ZipCRC32": 4114720355, "XADFileName": "Open_Data/MapingTables/地政/新竹縣.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 1365, "ZipOSName": "MS-DOS", "XADDataOffset": 243594193, "XADLastModificationDate": "2018-08-03 18:58:34 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 3514, "XADCompressedSize": 1365, "XADIndex": 41 }, { "ZipLocalDate": 1292080683, "ZipCRC32": 3210973739, "XADFileName": "Open_Data/MapingTables/地政/桃園縣.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 8200, "ZipOSName": "MS-DOS", "XADDataOffset": 243595626, "XADLastModificationDate": "2018-08-03 18:49:22 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 22223, "XADCompressedSize": 8200, "XADIndex": 42 }, { "ZipLocalDate": 1292081285, "ZipCRC32": 647919999, "XADFileName": "Open_Data/MapingTables/地政/澎湖縣.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 9839, "ZipOSName": "MS-DOS", "XADDataOffset": 243603894, "XADLastModificationDate": "2018-08-03 19:04:10 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 26779, "XADCompressedSize": 9839, "XADIndex": 43 }, { "ZipLocalDate": 1292080470, "ZipCRC32": 592539808, "XADFileName": "Open_Data/MapingTables/地政/花蓮縣.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 368, "ZipOSName": "MS-DOS", "XADDataOffset": 243613801, "XADLastModificationDate": "2018-08-03 18:42:44 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 816, "XADCompressedSize": 368, "XADIndex": 44 }, { "ZipLocalDate": 1292080632, "ZipCRC32": 3912934268, "XADFileName": "Open_Data/MapingTables/地政/苗栗縣.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 2520, "ZipOSName": "MS-DOS", "XADDataOffset": 243614237, "XADLastModificationDate": "2018-08-03 18:47:48 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 6588, "XADCompressedSize": 2520, "XADIndex": 45 }, { "ZipLocalDate": 1292080874, "ZipCRC32": 51963045, "XADFileName": "Open_Data/MapingTables/地政/連江縣.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 144, "ZipOSName": "MS-DOS", "XADDataOffset": 243616825, "XADLastModificationDate": "2018-08-03 18:55:20 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 330, "XADCompressedSize": 144, "XADIndex": 46 }, { "ZipLocalDate": 1292080508, "ZipCRC32": 4131769224, "XADFileName": "Open_Data/MapingTables/地政/金門縣.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 1501, "ZipOSName": "MS-DOS", "XADDataOffset": 243617037, "XADLastModificationDate": "2018-08-03 18:43:56 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 4018, "XADCompressedSize": 1501, "XADIndex": 47 }, { "ZipLocalDate": 1292080902, "ZipCRC32": 2820806083, "XADFileName": "Open_Data/MapingTables/地政/雲林縣.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 12738, "ZipOSName": "MS-DOS", "XADDataOffset": 243618606, "XADLastModificationDate": "2018-08-03 18:56:12 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 34584, "XADCompressedSize": 12738, "XADIndex": 48 }, { "ZipLocalDate": 1292080718, "ZipCRC32": 4110075771, "XADFileName": "Open_Data/MapingTables/地政/高雄市.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 6728, "ZipOSName": "MS-DOS", "XADDataOffset": 243631412, "XADLastModificationDate": "2018-08-03 18:50:28 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 17958, "XADCompressedSize": 6728, "XADIndex": 49 }, { "ZipLocalDate": 1292080784, "ZipCRC32": 1562408578, "XADFileName": "Open_Data/MapingTables/地政/高雄縣.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 11881, "ZipOSName": "MS-DOS", "XADDataOffset": 243638208, "XADLastModificationDate": "2018-08-03 18:52:32 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 32893, "XADCompressedSize": 11881, "XADIndex": 50 }, { "ZipLocalDate": 1292989408, "ZipCRC32": 0, "XADFileName": "Open_Data/Properties", "XADCompressionName": "None", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 16, "ZipCompressionMethod": 0, "XADDataLength": 0, "XADIsDirectory": 1, "ZipOSName": "MS-DOS", "XADDataOffset": 243650140, "XADLastModificationDate": "2018-08-17 14:31:00 +0800", "XADDOSFileAttributes": 16, "ZipOS": 0, "XADFileSize": 0, "XADCompressedSize": 0, "XADIndex": 51 }, { "ZipLocalDate": 1293853929, "ZipCRC32": 1003241584, "XADFileName": "Open_Data/Properties/CNS_cangjie.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 445299, "ZipOSName": "MS-DOS", "XADDataOffset": 243650206, "XADLastModificationDate": "2018-08-30 20:39:18 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 1324233, "XADCompressedSize": 445299, "XADIndex": 52 }, { "ZipLocalDate": 1293853913, "ZipCRC32": 136455775, "XADFileName": "Open_Data/Properties/CNS_component.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 585753, "ZipOSName": "MS-DOS", "XADDataOffset": 244095573, "XADLastModificationDate": "2018-08-30 20:38:50 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 2074497, "XADCompressedSize": 585753, "XADIndex": 53 }, { "ZipLocalDate": 1263565729, "ZipCRC32": 653207540, "XADFileName": "Open_Data/Properties/CNS_component_word.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 1474, "ZipOSName": "MS-DOS", "XADDataOffset": 244681399, "XADLastModificationDate": "2017-10-16 15:29:02 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 4950, "XADCompressedSize": 1474, "XADIndex": 54 }, { "ZipLocalDate": 1222346599, "ZipCRC32": 1868019446, "XADFileName": "Open_Data/Properties/CNS_component_word.zip", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 296154, "ZipOSName": "MS-DOS", "XADDataOffset": 244682946, "XADLastModificationDate": "2016-06-27 16:59:14 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 349210, "XADCompressedSize": 296154, "XADIndex": 55 }, { "ZipLocalDate": 1293853879, "ZipCRC32": 969203017, "XADFileName": "Open_Data/Properties/CNS_phonetic.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 424155, "ZipOSName": "MS-DOS", "XADDataOffset": 244979167, "XADLastModificationDate": "2018-08-30 20:37:46 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 1934752, "XADCompressedSize": 424155, "XADIndex": 56 }, { "ZipLocalDate": 1291816585, "ZipCRC32": 2558933854, "XADFileName": "Open_Data/Properties/CNS_pinyin.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 12635, "ZipOSName": "MS-DOS", "XADDataOffset": 245403387, "XADLastModificationDate": "2018-07-31 17:52:18 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 48009, "XADCompressedSize": 12635, "XADIndex": 57 }, { "ZipLocalDate": 1293853858, "ZipCRC32": 3808528593, "XADFileName": "Open_Data/Properties/CNS_radical.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 188172, "ZipOSName": "MS-DOS", "XADDataOffset": 245416088, "XADLastModificationDate": "2018-08-30 20:37:04 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 1058104, "XADCompressedSize": 188172, "XADIndex": 58 }, { "ZipLocalDate": 1291816584, "ZipCRC32": 3648975432, "XADFileName": "Open_Data/Properties/CNS_radical_word.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 1102, "ZipOSName": "MS-DOS", "XADDataOffset": 245604331, "XADLastModificationDate": "2018-07-31 17:52:16 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 2199, "XADCompressedSize": 1102, "XADIndex": 59 }, { "ZipLocalDate": 1293853813, "ZipCRC32": 1575847979, "XADFileName": "Open_Data/Properties/CNS_stroke.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 153761, "ZipOSName": "MS-DOS", "XADDataOffset": 245605498, "XADLastModificationDate": "2018-08-30 20:35:42 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 996851, "XADCompressedSize": 153761, "XADIndex": 60 }, { "ZipLocalDate": 1293853949, "ZipCRC32": 1348997946, "XADFileName": "Open_Data/Properties/CNS_strokes_sequence.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 539503, "ZipOSName": "MS-DOS", "XADDataOffset": 245759334, "XADLastModificationDate": "2018-08-30 20:39:58 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 2125144, "XADCompressedSize": 539503, "XADIndex": 61 }, { "ZipLocalDate": 1292013351, "ZipCRC32": 287037434, "XADFileName": "Open_Data/Properties/全字庫屬性資料說明文件.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 846, "ZipOSName": "MS-DOS", "XADDataOffset": 246298914, "XADLastModificationDate": "2018-08-02 17:57:14 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 3523, "XADCompressedSize": 846, "XADIndex": 62 }, { "ZipLocalDate": 1293898936, "ZipCRC32": 2842985452, "XADFileName": "Open_Data/資料更新說明.txt", "XADCompressionName": "Deflate", "ZipExtractVersion": 20, "ZipFlags": 0, "ZipFileAttributes": 32, "ZipCompressionMethod": 8, "XADDataLength": 555, "ZipOSName": "MS-DOS", "XADDataOffset": 246299816, "XADLastModificationDate": "2018-08-31 10:37:48 +0800", "XADDOSFileAttributes": 32, "ZipOS": 0, "XADFileSize": 1447, "XADCompressedSize": 555, "XADIndex": 63 } ], "lsarEncoding": "Big5", "lsarConfidence": 0.99, "lsarFormatName": "Zip", "lsarProperties": { "XADArchiveName": "Open_Data.zip", "XADVolumes": [ "Open_Data.zip" ] } } 接下來會探討「file-roller」如何讓「unar」可以「Work」,撰寫中,待續 先參考修改後的範例 * file-roller * engrampa
2018/9/28 23:25
|
||||||||||
![]() |
回覆: [分享] 解壓縮zip檔,產生亂碼,如何解決的心得 |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員五級
![]() ![]() 註冊日期:
2012/4/22 10:50 所屬群組:
已註冊使用者 等級: 36
HP : 0 / 898
![]() |
接續「#12」,
研究了一下「file-roller」,發現是有支援「unar」的。 執行
顯示
================================================================================ ## 下載「file-roller」的「Source Package: file-roller」 執行
會下載下面三個檔案 * file-roller_3.28.0-1ubuntu1.debian.tar.xz * file-roller_3.28.0-1ubuntu1.dsc * file-roller_3.28.0.orig.tar.xz 並且解開到「file-roller-3.28.0」這個資料夾 ================================================================================ ## 編譯前置作業 ================================================================================ ### 安裝「build-essential」 執行下面指令安裝「build-essential」
================================================================================ ### build-dep 執行下面指令,安裝編譯時需要的相關套件。
要知道有哪些套件,可以執行下面指令觀看
顯示
================================================================================ ## 切換到「file-roller-3.28.0」 執行下面指令,切換到「file-roller-3.28.0」,這個資料夾
================================================================================ ## 開始編譯 執行下面指令,開始編譯
編譯成功後,會產生一個資料夾「obj-x86_64-linux-gnu」 ================================================================================ ## 觀看「obj-x86_64-linux-gnu」的資料夾結構 執行
顯示 obj-x86_64-linux-gnu ├── build.ninja ├── compile_commands.json ├── config.h ├── data │ ├── icons │ ├── org.gnome.FileRoller.appdata.xml │ ├── org.gnome.FileRoller.ArchiveManager1.service │ ├── org.gnome.FileRoller.desktop │ ├── org.gnome.FileRoller.desktop.in │ └── org.gnome.FileRoller.service ├── help ├── meson-logs │ └── meson-log.txt ├── meson-private │ ├── build.dat │ ├── cleantrees.dat │ ├── coredata.dat │ ├── install.dat │ ├── meson_benchmark_setup.dat │ ├── meson_exe_glib-mkenums_02fa0eaae8f246a4a6d1e1f3a51cee767a523d7f.dat │ ├── meson_exe_glib-mkenums_af77c30aed913d8546a6aa8b334d2fcf2c90a9f7.dat │ ├── meson_test_setup.dat │ ├── sanitycheckc.c │ └── sanitycheckc.exe ├── nautilus │ ├── libnautilus-fileroller.so │ └── nautilus-fileroller@sha │ ├── fileroller-module.c.o │ └── nautilus-fileroller.c.o ├── po └── src ├── commands │ ├── rpm2cpio │ └── rpm2cpio@exe │ └── rpm2cpio.c.o ├── file-roller ├── file-roller@exe │ ├── dlg-add.c.o │ ├── dlg-ask-password.c.o │ ├── dlg-batch-add.c.o │ ├── dlg-delete.c.o │ ├── dlg-extract.c.o │ ├── dlg-open-with.c.o │ ├── dlg-package-installer.c.o │ ├── dlg-password.c.o │ ├── dlg-prop.c.o │ ├── dlg-update.c.o │ ├── eggtreemultidnd.c.o │ ├── file-data.c.o │ ├── file-utils.c.o │ ├── fr-application.c.o │ ├── fr-application-menu.c.o │ ├── fr-archive.c.o │ ├── fr-archive-libarchive.c.o │ ├── fr-command-7z.c.o │ ├── fr-command-ace.c.o │ ├── fr-command-alz.c.o │ ├── fr-command-ar.c.o │ ├── fr-command-arj.c.o │ ├── fr-command-cfile.c.o │ ├── fr-command.c.o │ ├── fr-command-cpio.c.o │ ├── fr-command-dpkg.c.o │ ├── fr-command-iso.c.o │ ├── fr-command-jar.c.o │ ├── fr-command-lha.c.o │ ├── fr-command-lrzip.c.o │ ├── fr-command-rar.c.o │ ├── fr-command-rpm.c.o │ ├── fr-command-tar.c.o │ ├── fr-command-unarchiver.c.o │ ├── fr-command-unsquashfs.c.o │ ├── fr-command-unstuff.c.o │ ├── fr-command-zip.c.o │ ├── fr-command-zoo.c.o │ ├── fr-error.c.o │ ├── fr-file-selector-dialog.c.o │ ├── fr-init.c.o │ ├── fr-list-model.c.o │ ├── fr-location-bar.c.o │ ├── fr-new-archive-dialog.c.o │ ├── fr-process.c.o │ ├── fr-window-actions-callbacks.c.o │ ├── fr-window.c.o │ ├── gio-utils.c.o │ ├── glib-utils.c.o │ ├── gth-icon-cache.c.o │ ├── gtk-utils.c.o │ ├── java-utils.c.o │ ├── main.c.o │ ├── meson-generated_.._fr-enum-types.c.o │ ├── meson-generated_.._fr-marshal.c.o │ ├── meson-generated_.._fr-resources.c.o │ ├── open-file.c.o │ ├── preferences.c.o │ └── rar-utils.c.o ├── fr-enum-types.c ├── fr-enum-types.h ├── fr-marshal.c ├── fr-marshal.h ├── fr-resources.c ├── fr-resources.h ├── sh ├── test-server └── test-server@exe └── test-server.c.o 14 directories, 92 files ================================================================================ 執行
顯示
================================================================================ 因為是使用「meson」來輔助編譯,後端是使用「ninja-build」。 所以當我們修改了原始碼(主要會修改[src]底下的檔案), 可以先切換到「obj-x86_64-linux-gnu」,
然後在「obj-x86_64-linux-gnu」這個資料夾,只要執行下面指令
就會重新編譯了, 要測試,則是直接執行「obj-x86_64-linux-gnu/src/file-roller」這個執行檔就行了。 ================================================================================ 為了測試方便看到一些偵錯訊息,編譯之前可以先在「obj-x86_64-linux-gnu/config.h」加入下面一行
可以直接執行下面指令加入
然後編譯, 測試時只要在「Terminal」執行「obj-x86_64-linux-gnu/src/file-roller」, 然後開啟在「#12」提到的範例檔,就可以看到如下的訊息
接著解開「Open_Data.zip」會看到如下的訊息
上面就可以看到「file-roller」呼叫外部指令 觀看
解開
================================================================================ 上面編譯的方式,除了在「file-roller-3.28.0」這個資料夾,執行「./debian/rule build」, 也可以採用另一種方式 在「file-roller-3.28.0」這個資料夾, 執行
就會產生一個資料夾「build」 然後切換到「build」這個資料夾
然後執行下面指令編譯
然後可以執行「src/file-roller」來測試
另外編譯前,不需要修改「config.h」,加入「#define DEBUG 1」,預設就會有「#define DEBUG 1」。 ================================================================================ 上面這個模式,一樣可以套用在「GitHub」上的「file-roller」專案
================================================================================ 接下來,回到原本要討論的議題,討論如何修改原始碼,待續...
2018/9/29 0:46
|
||||||||||
![]() |
回覆: [分享] 解壓縮zip檔,產生亂碼,如何解決的心得 |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員五級
![]() ![]() 註冊日期:
2012/4/22 10:50 所屬群組:
已註冊使用者 等級: 36
HP : 0 / 898
![]() |
接下來先在「file-roller-3.28.0」這個資料夾,可以看到一個檔案「HACKING」
可以看到幾個檔案可以當作探索的起點的 * src/fr-init.c * src/fr-archive.c * src/fr-archive-libarchive.c * src/fr-command.c * src/fr-process.c ================================================================================ 以下討論的修改,主要是在「src/fr-init.c」這個檔案。 ================================================================================ 先找到「register_archives」這個「function」。 執行
顯示 352- 353-static void 354:register_archives (void) 355-{ 356- /* The order here is important. Commands registered earlier have higher 357- * priority. However commands that can read and write a file format 358- * have higher priority over commands that can only read the same 359- * format, regardless of the registration order. */ 360- 361-#if ENABLE_LIBARCHIVE 362- register_archive (FR_TYPE_ARCHIVE_LIBARCHIVE); 363-#endif 364- 365- register_archive (FR_TYPE_COMMAND_TAR); 366- register_archive (FR_TYPE_COMMAND_CFILE); 367- register_archive (FR_TYPE_COMMAND_7Z); 368- register_archive (FR_TYPE_COMMAND_DPKG); 369- 370- register_archive (FR_TYPE_COMMAND_ACE); 371- register_archive (FR_TYPE_COMMAND_ALZ); 372- register_archive (FR_TYPE_COMMAND_AR); 373- register_archive (FR_TYPE_COMMAND_ARJ); 374- register_archive (FR_TYPE_COMMAND_CPIO); 375- register_archive (FR_TYPE_COMMAND_ISO); 376- register_archive (FR_TYPE_COMMAND_JAR); 377- register_archive (FR_TYPE_COMMAND_LHA); 378- register_archive (FR_TYPE_COMMAND_RAR); 379- register_archive (FR_TYPE_COMMAND_RPM); 380- register_archive (FR_TYPE_COMMAND_UNSQUASHFS); 381- register_archive (FR_TYPE_COMMAND_UNSTUFF); 382- register_archive (FR_TYPE_COMMAND_ZIP); 383- register_archive (FR_TYPE_COMMAND_LRZIP); 384- register_archive (FR_TYPE_COMMAND_ZOO); 385-#if HAVE_JSON_GLIB 386- register_archive (FR_TYPE_COMMAND_UNARCHIVER); 387-#endif 388-} 389- ================================================================================ 接著找到「get_archive_type_from_mime_type」這個「function」。 執行
顯示 GType get_archive_type_from_mime_type (const char *mime_type, FrArchiveCaps requested_capabilities) { int i; if (mime_type == NULL) return 0; for (i = 0; i < Registered_Archives->len; i++) { FrRegisteredArchive *command; FrArchiveCaps capabilities; command = g_ptr_array_index (Registered_Archives, i); capabilities = fr_registered_archive_get_capabilities (command, mime_type); /* the command must support all the requested capabilities */ if (((capabilities ^ requested_capabilities) & requested_capabilities) == 0) return command->type; } return 0; } 要修改成下面的程式碼
主要是加入藍色的那段程式碼。 至於為啥要這樣修改,除了參考「HACKING」的說明, 還有上面提到的「register_archives」這個「function」裡面有一個註解如下 356- /* The order here is important. Commands registered earlier have higher 357- * priority. However commands that can read and write a file format 358- * have higher priority over commands that can only read the same 359- * format, regardless of the registration order. */ 還有下面要找到的另一個註解。 ================================================================================ 接著找到「get_archive_type_from_mime_type」這個「function」在哪裡被呼叫。 執行
顯示 src/fr-archive.c:596: archive_type = get_archive_type_from_mime_type (mime_type, requested_capabilities); src/fr-archive.c:602: archive_type = get_archive_type_from_mime_type (mime_type, requested_capabilities); src/fr-archive.c:677: archive_type = get_archive_type_from_mime_type (mime_type, requested_capabilities); src/fr-archive.c:683: archive_type = get_archive_type_from_mime_type (mime_type, requested_capabilities); src/fr-init.c:392:get_archive_type_from_mime_type (const char *mime_type, src/fr-init.h:60:GType get_archive_type_from_mime_type (const char *mime_type, ================================================================================ 執行
顯示 579-FrArchive * 580-fr_archive_create (GFile *file, 581- const char *mime_type) 582-{ 583- FrArchiveCaps requested_capabilities; 584- GType archive_type; 585- FrArchive *archive; 586- GFile *parent; 587- 588- if (mime_type == NULL) 589- mime_type = _g_mime_type_get_from_filename (file); 590- 591- /* try with the CAN_READ capability as well, this way we give 592- * priority to the commands that can read and write over commands 593- * that can only create a specific file format. */ 594- 595- requested_capabilities = FR_ARCHIVE_CAN_READ_WRITE; 596: archive_type = get_archive_type_from_mime_type (mime_type, requested_capabilities); 597- 598- /* if no command was found, remove the read capability and try again */ 599- 600- if (archive_type == 0) { 601- requested_capabilities ^= FR_ARCHIVE_CAN_READ; 602: archive_type = get_archive_type_from_mime_type (mime_type, requested_capabilities); 603- } 604- 605- archive = create_archive_for_mime_type (archive_type, 606- file, 607- mime_type, 608- FR_ARCHIVE_CAN_WRITE); 609- 610- parent = g_file_get_parent (file); 611- archive->priv->have_write_permissions = _g_file_check_permissions (parent, W_OK); -- 660- 661- 662-static FrArchive * 663-create_archive_to_load_archive (GFile *file, 664- const char *mime_type) 665-{ 666- FrArchiveCaps requested_capabilities; 667- GType archive_type; 668- 669- if (mime_type == NULL) 670- return FALSE; 671- 672- /* try with the CAN_WRITE capability even when loading, this way we give 673- * [color=blue]priority to the commands that can read and write over commands 674- * [color=blue]that can only read a specific file format. */ 675- 676- requested_capabilities = FR_ARCHIVE_CAN_READ_WRITE; 677: archive_type = get_archive_type_from_mime_type (mime_type, requested_capabilities); 678- 679- /* if no command was found, remove the write capability and try again */ 680- 681- if (archive_type == 0) { 682- requested_capabilities ^= FR_ARCHIVE_CAN_WRITE; 683: archive_type = get_archive_type_from_mime_type (mime_type, requested_capabilities); 684- } 685- 686- return create_archive_for_mime_type (archive_type, 687- file, 688- mime_type, 689- requested_capabilities); 690-} 691- 692- ================================================================================ 從上面的藍色註解,和程式碼來猜測 關於「get_archive_type_from_mime_type」有可能會呼叫兩次, 第一次的「requested_capabilities」會設定為「FR_ARCHIVE_CAN_READ_WRITE」傳入到「get_archive_type_from_mime_type」 若得到的結果是「0」,就會呼叫第二次「get_archive_type_from_mime_type」, 這也是上面修改程式的用意,當第一次呼叫「get_archive_type_from_mime_type」 當「mime_type」是「"application/zip"」,而且「requested_capabilities」是「FR_ARCHIVE_CAN_READ_WRITE」,就直接回傳0。 if (g_ascii_strcasecmp(mime_type, "application/zip") == 0) { // only for zip if (requested_capabilities == FR_ARCHIVE_CAN_READ_WRITE) { // first call return 0; } 於是就會進到第二次呼叫的流程, else if (requested_capabilities == FR_ARCHIVE_CAN_READ) { // second call FrRegisteredArchive *command; //FrArchiveCaps capabilities; command = g_ptr_array_index (Registered_Archives, Registered_Archives->len-1); // last command -> FR_TYPE_COMMAND_UNARCHIVER //capabilities = fr_registered_archive_get_capabilities (command, mime_type); debug (DEBUG_INFO, "command->type: %d ", command->type); if (command->type == FR_TYPE_COMMAND_UNARCHIVER) { // force use unar return command->type; } } 也就是強制採用「FR_TYPE_COMMAND_UNARCHIVER」,然後回傳「command->type」。 當然這樣做,會有副作用,就只能觀看和解開壓縮檔,不能編輯壓縮檔。 ================================================================================ 於是接下來修改成第二版,修改如下 GType get_archive_type_from_mime_type (const char *mime_type, FrArchiveCaps requested_capabilities) { int i; if (mime_type == NULL) return 0; if (force_use_unar()) { // check force use unar if (g_ascii_strcasecmp(mime_type, "application/zip") == 0) { // only for zip if (requested_capabilities == FR_ARCHIVE_CAN_READ_WRITE) { // first call return 0; } else if (requested_capabilities == FR_ARCHIVE_CAN_READ) { // second call FrRegisteredArchive *command; //FrArchiveCaps capabilities; command = g_ptr_array_index (Registered_Archives, Registered_Archives->len-1); // last command -> FR_TYPE_COMMAND_UNARCHIVER //capabilities = fr_registered_archive_get_capabilities (command, mime_type); debug (DEBUG_INFO, "command->type: %d ", command->type); if (command->type == FR_TYPE_COMMAND_UNARCHIVER) { // force use unar return command->type; } } } } for (i = 0; i < Registered_Archives->len; i++) { FrRegisteredArchive *command; FrArchiveCaps capabilities; command = g_ptr_array_index (Registered_Archives, i); capabilities = fr_registered_archive_get_capabilities (command, mime_type); /* the command must support all the requested capabilities */ if (((capabilities ^ requested_capabilities) & requested_capabilities) == 0) return command->type; } return 0; } 加入一個旗標來檢測,是否強制採用「unar」。 這個機制設計在「force_use_unar」這個「function」,只是檢查「/tmp/force-use-unar」這個檔案是否存在, gboolean force_use_unar (void) { FILE* fp = fopen("/tmp/force-use-unar", "r"); if (fp) { // file exists fclose(fp); return TRUE; } else { // file doesn't exist return FALSE; } } 記得在「fr-init.h」要加入「宣告」如下: gboolean force_use_unar (void); ================================================================================ 接下來修改成第三版,採用「gsettings」的機制,來設計「force_use_unar」,程式碼修改如下 gboolean force_use_unar (void) { /* [preferences.h] FILE_ROLLER_SCHEMA_GENERAL = "org.gnome.FileRoller.General" PREF_GENERAL_FORCE_USE_UNAR = "force-use-unar" */ GSettings *settings; settings = g_settings_new (FILE_ROLLER_SCHEMA_GENERAL); if (g_settings_get_boolean (settings, PREF_GENERAL_FORCE_USE_UNAR) && _g_program_is_in_path ("unar") && _g_program_is_in_path ("lsar")) { g_object_unref (settings); return TRUE; } else { g_object_unref (settings); return FALSE; } } ================================================================================ 測試的時候,要修改「/usr/share/glib-2.0/schemas/org.gnome.FileRoller.gschema.xml」這個檔案
在「<schema id="org.gnome.FileRoller.General" path="/org/gnome/file-roller/general/" gettext-domain="file-roller">」那個區段,加入下面這一段 <key name="force-use-unar" type="b"> <default>false</default> <summary>Force use unar.</summary> <description>Force use unar to open zip archives.</description> </key> 接著執行
若沒有這個步驟,在測試「src/file-roller」的時候,會出現類似如下的提示訊息
================================================================================ 執行
顯示
執行
上面設定好後,就可以使用「src/file-roller」來測試 這時候可以看到如下的訊息
解開
從上面就可以看到改用「lsar」和「unar」兩個指令 觀看
解開
================================================================================ 若要不強制採用「unar」, 執行
或是執行下面指令,還原成預設值「false」
================================================================================ 在「GitHub」上,有放一個「file-roller」修改後的範例。 另外也有「engrampa」修改後的範例。 會修改「engrampa」,是因為看到這篇「討論」。 然後原本就有打算採用「gsettings」的方式,只是一開始不知道怎麼寫,剛好在修改「engrampa」,發生了提示訊息, 於是找到了另外兩篇討論,「討論一」和「討論二」, 於是就產生最後的「gsettings」的版本了。 ================================================================================ 以上提供參考,當作是探索的起點, 其實程式碼,我也沒完全看懂,只是用猜的和土法煉鋼的測試,才有上面的紀錄。 報告完畢 ![]()
2018/9/29 2:43
|
||||||||||
![]() |
回覆: [分享] 解壓縮zip檔,產生亂碼,如何解決的心得 |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員三級
![]() ![]() 註冊日期:
2017/3/23 10:15 所屬群組:
已註冊使用者 等級: 10
HP : 0 / 247
![]() |
打那麼多字不會累嗎 o.O
LANG=zh_TW.BIG5 unzip xxx.zip 這樣不行嗎 o.O 那 windows 下面解不就OK了
2018/9/29 22:56
|
||||||||||
![]() |
回覆: [分享] 解壓縮zip檔,產生亂碼,如何解決的心得 |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員五級
![]() ![]() 註冊日期:
2012/4/22 10:50 所屬群組:
已註冊使用者 等級: 36
HP : 0 / 898
![]() |
呆丸廖添丁 寫到: 下指令的話,我以前是採用下面這個指令
之前有做了一些紀錄,放在「這一頁」或是「#1」 這一次是因為發現了新指令,只要執行下面指令,就會解開壓縮檔, 並且解開的過程中會自動偵測檔名編碼,然後做適當的轉換,就不會出現檔名亂碼的情形。
關於這部份,我有紀錄在「#12」 因為這次我是拆成三篇「#12」「#13」「#14」,這三篇要連著看。 會紀錄這個,除了給自己備忘,也給有想要進一部探究的人,一個探索的起點 雖然我也都是打指令居多,但還是有些人是有需要GUI的需求。 以上釐清! 最後感謝您提供了指令的另一個下法。 ![]()
2018/9/29 23:20
|
||||||||||
![]() |
回覆: [分享] 解壓縮zip檔,產生亂碼,如何解決的心得 |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員五級
![]() ![]() 註冊日期:
2012/4/22 10:50 所屬群組:
已註冊使用者 等級: 36
HP : 0 / 898
![]() |
剛剛修改了「lxqt-archiver」,修改範例一樣放在「GitHub」上,
修改方式,基本上跟修改「engrampa」是一樣的, 只是我只有修改到版本二,也就是使用「/tmp/force-use-unar」當作旗標。 請對照「#14」的修改說明。 另外因為我在「Ubuntu 18.04」編譯不起來「lxqt-archiver」, 所以我測試的時候,是下載「Lubuntu 18.10 (Cosmic Cuttlefish) Daily Build」來測試,是可以編譯成功,也可以成功測試。 以下是編譯參考步驟 裝好「Lubuntu 18.10 (Cosmic Cuttlefish) Daily Build」 ## apt-get update
## 安裝 build-essential 接著執行下面指令安裝「build-essential」
不過測試的時候,發現「build-essential」預設好像是安裝好的,若沒有安裝的話,請先安裝。 ## 安裝 lxqt-build-tools
## 安裝編譯所需套件
## 安裝 unar
## clone 專案 (可以下載我修改好的,或是原本的)
## 切換到 lxqt-archiver 資料夾
## 建立 build 資料夾
## 切換到 build 資料夾
## 執行 cmake
## 執行 make
## 執行 src/lxqt-archiver
## 下載測試檔
用剛剛的執行「lxqt-archiver」開啟「Open_Data.zip」,會看到檔名亂碼。 ## 產生「/tmp/force-use-unar」 接著執行下面指令,產生「/tmp/force-use-unar」
再開啟一次「Open_Data.zip」,就會看到檔名,是正常的中文顯示。 ## 移除「tmp/force-use-unar」 接著執行下面指令,移除「/tmp/force-use-unar」,收工。
以上提供參考 報告完畢 ![]()
2018/9/30 0:00
|
||||||||||
![]() |
回覆: [分享] 解壓縮zip檔,產生亂碼,如何解決的心得 |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員五級
![]() ![]() 註冊日期:
2012/4/22 10:50 所屬群組:
已註冊使用者 等級: 36
HP : 0 / 898
![]() |
根據「#14」提到的指令下法,
聯想到「#17」,也可以採用環境變數的方式,來做旗標切換。 $ man 3 getenv 不過我就不再修改「#17」那個專案了。 我把「function force_use_unar」的實做方式,寫在另一個範例「get_env」, 另外也整理了其他的方式,放在「demo-concept-option」這個專案裡。 以上提供參考 報告完畢 ![]()
2018/10/1 0:28
|
||||||||||
![]() |
您可以查看帖子.
您不可發帖.
您不可回覆.
您不可編輯自己的帖子.
您不可刪除自己的帖子.
您不可發起投票調查.
您不可在投票調查中投票.
您不可上傳附件.
您不可不經審核直接發帖.