When access Mysql's VARCHAR(or CHAR) field contained UTF8 string, and the size (number of bytes) of UTF8 string is more than the size (number of characters) of VARCHAR(N) field, nanodbc only return the front N bytes and lose tail data. For Mysql's VARCHAR field, its bytes is variable, but through the function SQLDescribeCol (nanodbc.cpp:2724) only get the static max number of characters (sqlsize), and only copy sqlsize byte.const char* s = col.pdata_ + rowset_position_ * col.clen_;
(nanodbc.cpp:3021)
E4 B8 96 E7 95 8C E4 BD A0 E5 A5 BD
This is four Chinese character string encoding by UTF8, 3 bytes per Chinese character. This string can storage in the VARCHAR(10) field of Mysql, but only read the first 10 bytes.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4