Skip to content

Unicode support #244

Open
Open
@aafemt

Description

@aafemt

Currently the driver has two issues with Unicode functions:

  1. They are just front-end to ANSI functions that defeats their purpose: ability to work with symbols outside of ANSI codepage.
  2. A couple of bugs in ANSI<->Unicode conversion code assumes that SQLWCHAR is wchar_t and sizeof(wchar_t) is 2. The former makes the driver non-working with unixODBC and the latter - with iODBC.

I see following solutions for it:

  1. Drop charset option and fix the connection charset to NONE, performing conversion between storage charset and ANSI/Unicode on the client side. It will cause problems with server error messages and string literals in queries effectively limiting them to ASCII.
  2. Automatically set connection charset to match ANSI codepage (current locale) for SQL*Connect functions and fix it to UTF-8 for SQL*ConnectW functions. It will solve problems above but cause a new one with applications that use ANSI connection while still want to work with Unicode data using SQLGetData.
  3. Set connection charset to UTF-8 unconditionally and perform ANSI/Unicode conversions on the client side. No problems above but if the database charset is not UTF-8, a server-side conversion is enforced causing a higher load. Besides, it requires more changes in codebase.

So, no perfect solution. Or may be anyone see one?..

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions