Alexandru Balut : Fix character encoding for bugzilla query results
Module: appdb Branch: master Commit: 7a70a03b567daf44d7b16fa953d4659f7fc57a25 URL: http://source.winehq.org/git/appdb.git/?a=commit;h=7a70a03b567daf44d7b16fa95... Author: Alexandru Balut <alexandru.balut(a)gmail.com> Date: Thu Jun 3 15:24:02 2010 +0200 Fix character encoding for bugzilla query results --- include/query.php | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) 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);
participants (1)
-
Alexander Nicolaysen Sørnes