Force OpenX using UTF-8 charset

OpenX (aka Openads, PhpAdsNew) 在支援 UTF-8 不是很完整,須要手動指定編碼,才可以在使資料庫存取時使用正確的編碼。每次升級前也需記得先更正編碼的部份,否則更新程序會使用錯誤的編碼重新編了一資料,結果又會是一堆亂碼.

This is for mySQL only, and remember do the same changes before upgrade

file: openx/lib/OA/DB.php
search: $oDbh->setFetchMode(MDB2_FETCHMODE_ASSOC);
add after: $oDbh->query("SET NAMES utf8");

file: openx/lib/OA/Dal/Delivery/mysql.php
search: if (@mysql_select_db($dbName, $dbLink)) {
add before: @mysql_query("SET NAMES utf8");


Comments (4)

Login

E-mail
Password

Login with Facebook

If you have a facebook account, you may also connect with your facebook account

Login with Facebook

zhim! extended

zhim! extended is your own free personalized Chinese Input Method app on your iPhone or iPad. Great for typing text when mix-up Chinese and English without bothering switch between keyboards.



支援自訂輸入法詞庫
支援自訂輸入法鍵盤
支援自訂數字鍵快選候選字
支援外接鍵盤

已測試相容輸入法:
行列
倉頡
嘸蝦米
大易
倚天26
拼音
注音

Google Ads

About the Author

He is a freelance web developer who interested in front-end development, web accessibility, web design, graphic design and web development.