German Umlauts displaying problem

Hello, I have a problem with displaying of German umlaut-symbols after making a GET-request to XData which uses TMS-Aurelius, which accesses InterBase. I created a test endpoint (XData deployed in Google's Ubuntu VM) in order to demonstrate the problem.

Type definitions:

[Entity]
[Table('ADRESSEN')]
[Sequence('ADRESSEN_KENNZIFFER_GEN')]
[Id('FKENNZIFFER', TIdGenerator.IdentityOrSequence)]
TADRESSEN = class
private
    ...
    [Column('NAME3', [ ], 30)]
    FNAME3: Nullable<string>;
    ...
public
    ...
    property NAME3: Nullable<string> read FNAME3 write FNAME3;
    ...
end;

Endpoint registration:

[Authorize]
[HttpGet, Route('test')]
function Test: string;

Endpoint implementation:
function TAdressenService.Test: string;
var
  Manager: TObjectManager;
  Id: Integer;
  Adressen: TAdressen;
begin
  Id := 10275;
  Manager := TXDataOperationContext.Current.GetManager;
  Result := Manager.Find<TAdressen>(Id).NAME3;
end;

And after I do the request through Postman or web-based frontend, I get the following:
{
"value": "???????"
}
instead of:
{
"value": "ÄäÖöÜüß"
}

I saw similar problems in the support center, however, here's how my case is different:

  1. In the InterBase, 'NAME3' column of table 'ADRESSEN' has character set 'NONE'. And if I try to create a table with any other character set (WIN1252, UTF8, etc.), and write german umlauts inside, it results in an error, meaning that 'NONE' character set is the only way to go.
  2. In the Delphi IDE in the connection editor, I can also change the character set from 'NONE' to any other, but it also results in some kind of incompatibility error when calling the endpoint. Moreover, using SQL-script tab in the connection editor, I can execute the command which retrieves that 'NAME3' value, and everything is executed correctly, with umlauts displaying, which makes me think that the problem lies in how TMSAurelius is handling it.
  3. I tried using this line of code in the initialization of the project: TGlobalConfigs.GetInstance.MapStringToNationalChar := True;
    However, it doesn't seem to help even if I put it directly before the endpoint execution code.

What else I might be missing here?

Hello @_d.ayazbayev, welcome to TMS Support Center!

I'd recommend you first isolate the problem from Aurelius. Which database component are you using? FireDAC?

Try to simply executing a query command from your application (not from design-time), execute the SQL to retrieve NAME3 using the same component connection your are using with the TAureliusConnection. Are you able to retrieve the correct value?

If yes, then setting MapStringToNationalChar should be enough, but you should put it in the initialization of your project, before you do any Aurelius-related operation.

I am using FireDAC as a database component. I tried to omit TMSAurelius and used TFDQuery, but the result is surprisingly the same: question marks instead of German letters.

Here's how I changed TAdressenService.Test method to see how it works without TMSAurelius:

function TAdressenService.Test: string;
var
  Manager: TObjectManager;
  Id: Integer;
  Adressen: TAdressen;
  Bytes: TBytes;
  S: string;
  Query: TFDQuery;
begin
//  TGlobalConfigs.GetInstance.MapStringToNationalChar := True;
  Id := 10275;
//  Manager := TXDataOperationContext.Current.GetManager;
//  Result := Manager.Find<TAdressen>(Id).NAME3;
  Query := TFDQuery.Create(nil);
  try
    Query.Connection := DB.Connection;
    Query.SQL.Text := 'SELECT NAME3 FROM ADRESSEN WHERE KENNZIFFER = :Id';
    Query.ParamByName('Id').AsInteger := Id;

    Query.Open;

    if not Query.IsEmpty then
      Result := Query.FieldByName('NAME3').AsString
    else
      Result := 'Not found';
  finally
    Query.Free;
  end;
end;

According to your answer, the problem should be in something else then. I would be thankful if you gave me a couple of ideas what it could be.

I decided to build the same code for the Windows now, and launch the server locally. In this case all the umlauts are shown correctly. At least some progress, but I'm still not sure what can it be, maybe there is some bug or just a small detail for the Ubuntu/Linux build? Here's the Google VM's OS info:

Distributor ID: Ubuntu
Description:    Ubuntu 22.04.5 LTS
Release:        22.04
Codename:       jammy

Maybe the default value for client CharacterSet is different from Linux to Windows and you have to set the correct one explicitly?

I would suggest isolate even further and use an Interbase client app without using Delphi to see the results.

Unfortunately, when I change CharacterSet in the connection params, I get the same error no matter which one I chose, WIN1252, UTF8, or anything else which could make sense.

ERROR: arithmetic exception, numeric overflow, or string truncation
Cannot transliterate character between character sets

Also, in the InterBase, when I create the test table with the different character set than NONE, I cannot write anything there even manually, if it contains Umlauts.
Both these problems make me feel like I should proceed with character set of NONE, but of course I might be missing something as I said earlier.

I also tried to isolate the problem even further by executing InterBase client in my Google VM and sending GET request to my database, which returns garbled values instead of Umlauts, not even question marks.

Looks like an Interbase issue or misconfiguration. I'm really not proficient in Interbase on Linux, I'm not sure how can I be of further help.

Have you tried maybe googling for similar issues in Firebird? Firebird is a fork from Interbase but has more information around the web, so maybe there are information about this issue with Firebird that you can extrapolate to Interbase.