Unidac - MSSQL - Linux

Unidac - MSSQL - Linux

Hi everyone

I am migrating a REST application (DMVC Framework) that uses Unidac to access a MS SQL Server 2022.

When executing a query with data containing accented characters, all of them are replaced by "?".

When compiled and executed on Windows, the problem does not occur.

SO: Ubuntu 22.04 (server/desktop)
Unidac version: 9.4.0
Delphi version: Studio 11 Version 28.0.47991.2819 
SQL Server 2022 - Collation SQL_Latin1_General_CP850_CI_AI

  1. uses
  2.   ..., Data.DB, DBAccess, Uni, UniProvider, SQLServerUniProvider, ...;
  3. //
  4. procedure TestConnection;
  5. var
  6.   lDB: TUniConnection;
  7.   lQry: TUniQuery;
  8.   lResult: TJSONObject;
  9.   lReports: TJSONArray;
  10. begin
  11.   lDB := TUniConnection.Create(nil);
  12.   lDB.ProviderName := 'SQL Server';
  13.   lDB.Server := 'my-sql-server-host-on-windows-server';
  14.   lDB.Username := 'my-user';
  15.   lDB.Password := 'my-pwd';
  16.   lDB.LoginPrompt := False;
  17.   lDB.Open;
  18.   if lDB.Connected then begin
  19.     lQry := TUniQuery.Create(nil);
  20.     lQry.Connection := lDB;
  21.     lQry.SQL.Text := 'SELECT TOP 1 db_field_with_accent_value FROM my_table';
  22.     lQry.Open;
  23.     // expected value: "Relatório de Títulos por Situação"
  24.     // found: "Relat?rio de T?tulos por Situa??o"
  25.     lQry.Close;
  26.   end;
  27.   lDB.Close;
  28. end;

Using the same query with Firedac works on Windows and Linux.

What is wrong in the source code above?