Opened 16 years ago

Closed 16 years ago

#2467 closed enhancement (fixed)

mysql default client charset to utf-8

Reported by: wolgri Owned by: warmerdam
Priority: normal Milestone: 1.6.0
Component: OGR_SF Version: 1.5.2
Severity: minor Keywords: ogr mysql utf8 RFC23
Cc:

Description

if there isno way to change client charset in ogr so whay need to use default swedish collation here some ugly workaround to fix this

diff -Naur gdal-1.5.2.orig/ogr/ogrsf_frmts/mysql/ogrmysqldatasource.cpp gdal-1.5.2/ogr/ogrsf_frmts/mysql/ogrmysqldatasource.cpp
--- gdal-1.5.2.orig/ogr/ogrsf_frmts/mysql/ogrmysqldatasource.cpp    2007-01-18 04:22:39.000000000 +0200
+++ gdal-1.5.2/ogr/ogrsf_frmts/mysql/ogrmysqldatasource.cpp 2008-07-11 12:18:35.000000000 +0300
@@ -209,7 +209,7 @@

     unsigned int timeout = atoi(pszTimeoutLength);
     mysql_options(hConn, MYSQL_OPT_CONNECT_TIMEOUT, (char*)&timeout);
-
+    mysql_options(hConn, MYSQL_SET_CHARSET_NAME, "utf8");
     if( hConn == NULL )
     {
         CPLError( CE_Failure, CPLE_AppDefined,
~

Attachments (1)

gdal.mysql.patch (627 bytes ) - added by wolgri 16 years ago.

Download all attachments as: .zip

Change History (3)

by wolgri, 16 years ago

Attachment: gdal.mysql.patch added

comment:1 by warmerdam, 16 years ago

Keywords: RFC23 added
Milestone: 1.6.0
Status: newassigned

Per RFC 23 things ought to operate in UTF-8 in trunk. It is less clear what is appropriate in 1.5, so rather than rock the boat I'm just going to apply this in trunk.

comment:2 by warmerdam, 16 years ago

Resolution: fixed
Status: assignedclosed

Change applied in trunk (r14887). I did not actually do any testing as it seems straight forward.

Note: See TracTickets for help on using tickets.