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

"Schroeder, Alexander" <[email protected]>
Newsgroups gmane.comp.db.sapdb.general
Message-ID <[email protected]>
Hello Hannes,

As also the PHP ODBC functions return their results as strings, there is little 
hope here fon convincing them to do something with Unicode. All columns of the result
set are bound as SQL_C_CHAR by PHP, any Unicode data would be an SQL_C_WCHAR or 
(if UNICODE defined) an SQL_C_TCHAR ...

Unfortunately, there is also no kind of SQL function in MaxDB that can
generates CHAR UNICODE data from some encoded input, or encodes
CHAR UNICODE data e.g. into UTF8.

As long as you don't want searching or sorting or calling of functions like LENGTH, 
you may put that UTF8 into a normal (VAR)CHAR ASCII column, but I fear this will
have only little use for a real application, as that's the normal job of the 
database ...

So, there is probably no real trick.

Regards

Alexander Schröder
SAP DB, SAP Labs Berlin 

> -----Original Message-----
> From: Hannes Edinger [mailto:[email protected]]
> Sent: Thursday, August 14, 2003 12:52 PM
> To: [email protected]
> Subject: Re: ODBC: Unicode conversion from UTF-8 to UCS-2
> 
> 
> Thanks Thomas! Thanks Sven!
> 
> Didn't know that this is a matter of PHP-ODBC and not of SAPDB... Now 
> I'm really in trouble! :-)
> 
> Is there any trick to get Unicode encoded data into a Unicode column 
> without using the ODBC-Wide-API?
> 
> Regards,
> Hannes
> 
> Sven Köhler wrote:
> 
> >> 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:
> >
> >
> > He's talking about PHP, and i just looked it up:
> > PHP doesn't offer access to the unicode-aware functions of 
> the ODBC API. 
> 
> 
> 
> _______________________________________________
> sapdb.general mailing list
> [email protected]
> http://listserv.sap.com/mailman/listinfo/sapdb.general
>
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.