[unixODBC-dev] Question about who does the localisation conversions

Bill Medland billmedland at mercuryspeed.com
Fri Mar 4 00:41:45 GMT 2005


For the record only.

On March 1, 2005 12:11 pm, Nick Gorham wrote:
> Bill Medland wrote:
> >Can anyone help on this?
> >
> >We have a program running under Wine through unixODBC down into IBM DB2.
> >
> >In order to get Spanish display under Wine we set the LANG to es_ES under
> >Linux.  (Under Windows we set the regional settings)
> >
> >When we get a decimal number (DECIMAL length 19 scale 3) from the database
> >under windows through ODBC it comes through with a period as the decimal
> >point separator.
> >
> >If I use the db2 command itself to query the database, using
> >LANG=es_ES db2
> >then it displays with a period for the decimal point.

It must have been my imagination.  That statement not replicated.

> >
> >If I use isql to query the database, using
> >LANG=es_ES <dbname> <username> <password>
> >then it displays with a comma for the decimal point.
> >
> >Can anyone confirm or deny for me that unixODBC will be doing the
> > conversion from the underlying database type on the basis of the LANG
> > setting?  Or is it likely that it is the actual database drived?
>
> unixODBC will try and use iconv if its present to convert to and from 16
> bit unicode to ascii if needed, but will not do any of the sort of
> conversions you are talking about.
>
> I would check if there are any attributes that can be set either via the
> API or in the ini file for the db2 driver.
>

Indeed the DB2 driver/CLI does do the conversion based on the locale.
In order to prevent this (and we reckon ODBC basically stipulates that only a 
period should be used for the decimal separator, no matter what the locale) 
then specify "Patch2=15" either in the SQLDriverConnect call or add it to a 
suitable entry in the database instance's ~/sqllib/cfg/db2cli.ini file.

> --
> Nick
>
> _______________________________________________
> unixODBC-dev mailing list
> unixODBC-dev at easysoft.com
> http://mail.easysoft.com/mailman/listinfo/unixodbc-dev

-- 
Bill Medland
mailto:billmedland at mercuryspeed.com
http://webhome.idirect.com/~kbmed




More information about the unixODBC-dev mailing list