Getting unicode text out of SQL Server

Ben Rubinstein benr_mc at cogapp.com
Tue Oct 23 11:10:34 EDT 2012


LiveCode now has vastly expanded Unicode functionality, huzzah.

Meanwhile many of the database-based applications that my clients use have 
been gradually upgraded to support Unicode also, huzzah.  (Apparently, the one 
we're currently interested in at least is storing the data as UTF-16LE.)

However, the LiveCode-based apps which we've written that extract data from 
those databases over ODBC, get nowt from the new fields when those 
applications are updated, using our basic eg "SELECT x, y FROM z" query (where 
y is a text column) .  The solution we've got so far is to apply conversion in 
the query as eg  "SELECT x, y as VARCHAR(255) FROM z".  This works, but we're 
only getting back Windows Latin 1 text, which is what we had before.  Fine for 
now because all the data is just migrated from the previous version - but 
sooner or later, they'll start using the new capability to insert text which 
can be represented in Windows Latin 1, and then we'll presumably get missing 
chars out.

(How) could we get the data out as UTF or something else that we can work with 
in LiveCode and which captures the full range of data that might have been 
stored in SQL Server?  Is this just a matter of the correct SQL query, or is 
there likely a limitation either in ODBC SQL Server driver or in the LiveCode 
ODBC interface that will prevent us?

Any light shed will be gratefully bathed in,

Ben




More information about the use-livecode mailing list