3

Let's imagine I have a legacy application that I would like to connect to a modern SQL Server. This legacy application only understands ASCII, but the SQL Server contains Unicode data in nvarchar column types. Is there an option I can set at the user or connection level to have SQL Server map extended characters back into their nearest ASCII equivalent? E.g. any of à á â ã ã ã in a value returned in a query would be return as plain a, any of è é ê ë would be plain e and so on.

  • 1
    There is no session-level setting that will automatically convert Unicode to ASCII. Does the legacy app only use ASCII characters 0-127 or does it use a code page to map characters in the 128-255 range? What programming language and client API are you using? – Dan Guzman Jun 17 '18 at 12:00
  • I suspected that would be the case. I suppose I could write an ODBC shim to iconv() the result set as it goes through. Thanks :-) – Gaius Jun 17 '18 at 13:55
  • 1
    That depends on the capability of the specific version of the ODBC driver on the client. If that version supports Unicode, it will be able to convert automatically to the client code page. – mustaccio Jul 12 '18 at 15:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.