Tommy 碎碎念

Tommy Wu's blog

« 上一篇 | 下一篇 »

修正 Gallery 2.2 產生空白 install_registry.reg 檔案的問題
post by tommy @ 06 五月, 2007 20:00

在 Gallery 2.1 的時候, 我記得沒有這個問題, 只是... 產生的檔案, 會是 UTF-8 的編碼, 在 Windows 下頭, 那一些中文反而是亂碼. 但是... 今天發現, 在 Gallery 2.2 的時候, 這個檔案就完全空白了. 大小變成 0.

看了一下 modules/publishxp/DownloadRegistryFile.inc 的內容, 多了一段轉碼的程式, 會把產生的檔案內容, 由 UTF-8 轉成 Windows 使用的編碼. 不過.... 下頭那個判斷編碼的函式, 所產生的編碼名稱, 是 Windows-xxx 之類的名稱, 而不是 CPxxx 之類的名稱. 舉例來說, 中文應該是 CP950 編碼, 會變成 Windows-950 這個名稱. 所以在後續實際的轉碼地方, 執行 iconv() 時, 就轉不出東西來. 檔案大小自然就變成 0 了.

--- modules/publishxp/DownloadRegistryFile.inc.orig 2007-05-06 19:50:50.978507489 +0800
+++ modules/publishxp/DownloadRegistryFile.inc 2007-05-06 19:50:41.050250631 +0800
@@ -200,7 +200,7 @@
break;
default: $codePage = 1252;
}
- return 'Windows-' . $codePage;
+ return 'CP' . $codePage;
}
}
?>

上頭這個 patch 可以修正這個問題.

檔案可以由這兒抓取:  http://www.teatime.com.tw/~tommy/mypatch/gallery_publishxp_encoding.patch

這個修正也提交給 Gallery, 不過... 同樣, 會不會被接受我就不保證了. 有需要就自行修正吧.

Del.icio.us Furl HEMiDEMi Technorati MyShare
commons icon [1] Re:修正 Gallery 2.2 產生空白 install_registry.reg 檔案的問題 [ 回覆 ]

請問下載該修正檔後,應該如何使用?
謝謝您!

commons icon [2] Re:修正 Gallery 2.2 產生空白 install_registry.reg 檔案的問題 [ 回覆 ]

把 modules/publishxp 目錄下的 DownloadRegistryFile.inc 檔案打開, 裡頭找到 return 'Windows-' . $codePage; 改成 return 'CP' . $codePage; 就可以了.

commons icon [3] Re:修正 Gallery 2.2 產生空白 install_registry.reg 檔案的問題 [ 回覆 ]

謝謝站長的解答,問題已解決!

commons icon [4] Re:修正 Gallery 2.2 產生空白 install_registry.reg 檔案的問題 [ 回覆 ]

您好
我在下載了 install_registry.reg 之後,
也如同您所提的檔案大小為 0KB.

看完了您回覆小林的問題,
我也將return 'Windows-' . $codePage; 改成 return 'CP' . $codePage;

然後我重新 run 了一次 install_registry.reg
可是還是得到相同的結果
錯誤訊息如下~
無法匯入 E:\intall_registry.reg: 指定的檔案不是登錄指令碼。您只能在登錄編輯程式中匯入登錄檔案。

請問我是缺少了什麼步驟,
還是我哪一個地方坐錯了嗎?

網路新手,正在努力學習中,盼望能獲得解決的方法.
非常謝謝您!

commons icon [5] Re:修正 Gallery 2.2 產生空白 install_registry.reg 檔案的問題 [ 回覆 ]

感謝你的這篇....我困擾很久了....
想說怎麼雄雄壞了.....

commons icon [6] Re:修正 Gallery 2.2 產生空白 install_registry.reg 檔案的問題 [ 回覆 ]

有你這篇真好!!謝謝!!

commons icon [7] Re:修正 Gallery 2.2 產生空白 install_registry.reg 檔案的問題 [ 回覆 ]

謝謝你分享 patch 解決登錄檔0位元的問題..

另,可引用您的 patch code 在我的部落格中嗎?若您不希望,我會將其移除的,謝謝..

commons icon [8] Re:修正 Gallery 2.2 產生空白 install_registry.reg 檔案的問題 [ 回覆 ]

可以啊. 歡迎使用吧.
可是, 目前的版本還需要這個 patch 嗎? Gallery 開發群有接受這個 patch, 只是我也不確定是會在 2.3 還是在 2.2.x 裡頭.

commons icon [9] Re:修正 Gallery 2.2 產生空白 install_registry.reg 檔案的問題 [ 回覆 ]

謝謝~
目前 Gallery2.2.4版仍然有這問題,希望在未來可以被解決,對繁體中文的支援度能更好,再次感謝了~:)

commons icon [10] Re:修正 Gallery 2.2 產生空白 install_registry.reg 檔案的問題 [ 回覆 ]

您好:
可剻提供稍微詳細的步驟~~第一步就找不到了~~謝謝~

commons icon [11] Re:修正 Gallery 2.2 產生空白 install_registry.reg 檔案的問題 [ 回覆 ]

詳細? 上頭的已經很詳細了. 如果你連那個檔案都找不到, 請別人幫你找看看吧, 不然就當做本來就沒這個功能好了.

迴響
暱稱:
標題:
個人網頁:
電子郵件:
authimage

迴響

  

Bad Behavior 已經阻擋了 136 個過去 7 天試圖闖關的垃圾迴響與引用。
Power by LifeType. Template design by JamesHuang. Valid XHTML and CSS