Unicode / Datasnap
Posted: Wed 28 Apr 2010 16:46
Hello,
We are using the DevArt dbexpoda40.dll (4.50.0.19) driver in an application with a client-server version with direct database connections, and a soap version, which relies on a Datasnap appllication on the server to access the database. The compiler for both is Delphi 2010.
When connecting directly to the database, everything works fine, and we can read/write Unicode 16 (native Delphi) strings with no problems.
When connecting over Datasnap, there are two issues. One is that datasnap seems to use UTF8 in its soap messages, so we need to convert strings to Unicode from UTF8 when reading/writing them to the database. This works fine when using database fields using a custom descendant of TField.
The second problem, which is the real show-stopper, is that, when updating the DB using SQL strings that contain Chinese characters (like update...set column_nm='[Chinese string]'), the strings make it to the server ok, but they are converted to '????' by the time they make it into the database.
Using explicit Unicode in SQL works fine in the client/server environment. Both it and the soap server use TSqlQuery and TSqlConnection objects, and the identical SQL works fine in client/server.
Initializing the connection object and the query object identically has no effect, so it seems like it may be related to the Datasnap environment.
It doesn't seem to have anything to do with the soap transfer since I have the same problem when the SQL is hard-coded in the server code.
The driver "UseUnicode" and "Unicode Environment" are both set to "True" in the supplied DBXDevArtOracle.
Any ideas?
Thanks!
Gordon
We are using the DevArt dbexpoda40.dll (4.50.0.19) driver in an application with a client-server version with direct database connections, and a soap version, which relies on a Datasnap appllication on the server to access the database. The compiler for both is Delphi 2010.
When connecting directly to the database, everything works fine, and we can read/write Unicode 16 (native Delphi) strings with no problems.
When connecting over Datasnap, there are two issues. One is that datasnap seems to use UTF8 in its soap messages, so we need to convert strings to Unicode from UTF8 when reading/writing them to the database. This works fine when using database fields using a custom descendant of TField.
The second problem, which is the real show-stopper, is that, when updating the DB using SQL strings that contain Chinese characters (like update...set column_nm='[Chinese string]'), the strings make it to the server ok, but they are converted to '????' by the time they make it into the database.
Using explicit Unicode in SQL works fine in the client/server environment. Both it and the soap server use TSqlQuery and TSqlConnection objects, and the identical SQL works fine in client/server.
Initializing the connection object and the query object identically has no effect, so it seems like it may be related to the Datasnap environment.
It doesn't seem to have anything to do with the soap transfer since I have the same problem when the SQL is hard-coded in the server code.
The driver "UseUnicode" and "Unicode Environment" are both set to "True" in the supplied DBXDevArtOracle.
Any ideas?
Thanks!
Gordon