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");
Force OpenX using UTF-8 charset
Posted in: Programming, 2,337 people viewed this story.
