Author Topic: ANSI vs Unicode on mysql-obdc  (Read 3449 times)

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
ANSI vs Unicode on mysql-obdc
« on: มิถุนายน 15, 2018, 11:00:46 PM »
Connector/ODBC offers the flexibility to handle data using any character set through its Unicode-enabled driver,
or the maximum raw speed for a more limited range of character sets through its ANSI driver

https://dev.mysql.com/doc/connector-odbc/en/connector-odbc-installation.html

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
Re: ANSI vs Unicode on mysql-obdc
« Reply #1 on: มิถุนายน 16, 2018, 02:14:05 PM »
Firstly I should say that I don't use MySQL but I do know about ODBC Drivers. In ODBC there are different APIs for unicode and ansi.

The ansi APIs end in A and
the unicode APIs end in W (e.g., SQLPrepareA and SQLPrepareW).

The ansi APIs accept bytes/octets for character strings and hence can only handle chrs 0-255.

The unicode APIs accept SQLWCHARs which are 2 byte UCS-2 encoded unicode codepoints (newer MS SQL Server versions can handle UTF16 encoded strings) and so can handle approximately the first 65000 codepoints in unicode.

So if you need to store unicode data you have no choice which driver to use.