Skip to content
Newer
Older
100644 53 lines (36 sloc) 2.23 KB
5504740 @mkleehammer Added notes.
authored
1
2 Unicode
3 -------
4
5 http://support.microsoft.com/default.aspx?scid=kb;EN-US;q294169
6
7 """
8 For many of these Unicode functions, the ODBC Programmer's Reference provides incorrect or
9 ambiguous descriptions for some of the function arguments. Specifically, this problem
10 relates to arguments that are used to specify the length of character string input and
11 output values."
12
13 Regardless of what the documentation says for each ODBC function, the following paragraph
14 from the Unicode section of "Chapter 17: Programming Considerations" in the ODBC
15 Programmer's Reference is the ultimate rule to use for length arguments in Unicode
16 functions:
17
18 "Unicode functions that always return or take strings or length arguments are passed as
19 count-of-characters. For functions that return length information for server data, the
20 display size and precision are described in number of characters. When a length
21 (transfer size of the data) could refer to string or nonstring data, the length is
22 described in octet lengths. For example, SQLGetInfoW will still take the length as
23 count-of-bytes, but SQLExecDirectW will use count-of-characters."
24
25 This means that if the argument in question describes the length of another argument that
26 is always a string (typically represented as a SQLCHAR), then the length reflects the
27 number of characters in the string. If the length argument describes another argument that
28 could be a string or some other data type (typically represented as a SQLPOINTER), the
29 length is in bytes.
30 """
31
32
33 Driver Support"
34
35 * PostgreSQL seems to correct use UCS-2.
36 http://archives.postgresql.org/pgsql-odbc/2006-02/msg00112.php
37
38 * MS SQL Server on Windows & Linux. Obviously correctly uses UCS-2.
39
40 * mysql: Seems to be broken. To handle this, probably need to provide a 'charset' option
41 that causes us to convert to the given charset and use the ANSI/ASCII calls and data types.
42
43 http://mysqlworkbench.org/?p=1399
44
45 * FreeTDS
46
47 http://www.freetds.org/userguide/unicodefreetds.htm
48
49 Definitely use 0.91 or later.
50
51 Have seen reference to a new --wide-unicode flag for 0.92+ (broken in 0.91) which causes
52 SQL_WCHAR to equal wchar_t instead of UCS-16.
Something went wrong with that request. Please try again.