RE: ODBC: Unicode conversion from UTF-8 to UCS-2

"Koetter, Thomas Theodor" <[email protected]>
Newsgroups gmane.comp.db.sapdb.general
Message-ID <[email protected]>
Hi Hannes

> -----Original Message-----
> From: [email protected] [mailto:[email protected]]
> Sent: Montag, 11. August 2003 22:48
> To: [email protected]
> Subject: ODBC: Unicode conversion from UTF-8 to UCS-2
> 
> 
> Hello!
> 
> I'm using the latest SAPDB ODBC driver (version 7.4.03.pre11 
> for Linux)
> to access a SAPDB 7.4.3 based database from PHP. The database instance
> is an Unicode instance (created with paramters _UNICODE=YES and
> DEFAULT_CODE=UNICODE).
> 
> I'm working on a web-app which receives UTF-8 encoded 
> multilingual form 
> data that should be inserted UCS-2 encoded into this 
> database. (Because 
> UPPER/LOWER/ORDER BY/etc. must work correctly on these strings.)
> 
> I tried to...

The ODBC driver expects in the ODBC-Wide-API (the functions with
a trailing "W" like SQLConnectW) UCS2 strings in a 2-bytes data type.
SQLWCHAR is defined in sqltypes.h, line 335:

typedef unsigned short SQLWCHAR;


If the problem persists please sent me a small program
for reproducing it.


Regards  Thomas


PS: In the source tree in the subdirectory src/sp you find
conversion routines in vsp81.c, vsp83.c.


----------------------------------------------
Dr. Thomas Kötter
SAP DB, SAP Labs Berlin


Hurry up, SAP DB is open source     www.sapdb.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.