[AppDB] patch: Request for UTF8-encoded results from MySQL when querying the bugs DB.

Alexandru Balut alexandru.balut at gmail.com
Sat May 1 10:29:05 CDT 2010


Resending because I got no response and the patch has not been committed yet.

Partial fix for bug http://bugs.winehq.org/show_bug.cgi?id=16514 -
some characters from the bug summary do not appear correctly when a
linked bug is displayed in the page showing a version of an app. For
example, see http://appdb.winehq.org/objectManager.php?sClass=version&iId=17511
and look in that page for bug 21156.

Tested in Chrome, and Firefox, with the following chars in the title:
Iñtërnâtiônàlizætiøn 素晴らしい翻訳はここ笑
-------------- next part --------------
diff --git a/include/query.php b/include/query.php
index 9527fb8..7b02e79 100644
--- a/include/query.php
+++ b/include/query.php
@@ -130,6 +130,12 @@ function query_bugzilladb($sQuery,$sComment="")
         $hBugzillaLink = mysql_connect(BUGZILLA_DBHOST, BUGZILLA_DBUSER, BUGZILLA_DBPASS, true);
         if(!$hBugzillaLink) return;
         mysql_select_db(BUGZILLA_DB, $hBugzillaLink);
+        // Tell MySQL to return UTF8-encoded results
+        $sQueryAskingForUtf8Results = "SET SESSION CHARACTER_SET_RESULTS = 'utf8'";
+        if (!mysql_query($sQueryAskingForUtf8Results, $hBugzillaLink))
+        {
+            query_error($sQueryAskingForUtf8Results, "", $hBugzillaLink);
+        }
     }
     
     $hResult = mysql_query($sQuery, $hBugzillaLink);


More information about the wine-patches mailing list