Describe the bug
If i use the AL-function UploadintoStream() then the Encoding of the Instream gets ignored. This means i cant change the Encoding, so if I import a file with german special characters like ß,ä,ö... cant get displayed in any Buisness Central table. I have this problem in BC15 SAAS-System.
To Reproduce
Use the function UploadIntoStream() to upload an ANSI-File wich has german letters to a stream.
If you load the data from the stream to a table, then german special characters are shown as a "?".
Code Example:
tempblob.CreateInStream(FileInstream, TextEncoding::Windows);
UploadIntoStream('Please chose a .txt import file', ImportFolder, 'txt files (.txt)|.txt', ImportFile, FileInstream);
CSVBuffer.DeleteAll();
CSVBuffer.LoadDataFromStream(FileInstream, ';');
IF CSVBuffer.FindSet() then
repeat
if (CSVBuffer."Field No." = 2) then
ORVProtelCustomerImport.Init();
case CSVBuffer."Field No." of
2:
begin
ORVProtelCustomerImport."Customer No." := FORMAT(DeleteBadChars(CSVBuffer.Value), 20);
IF Cust.Get(ORVProtelCustomerImport."Customer No.") then
ORVProtelCustomerImport."Customer exists" := true
else
ORVProtelCustomerImport."Customer exists" := false;
end;
4:
ORVProtelCustomerImport.Name := Format(DeleteBadChars(CSVBuffer.Value), 100);
5:
ORVProtelCustomerImport."Name 2" := Format(DeleteBadChars(CSVBuffer.Value), 50);
...
After filling the Values, ORVProtelCustomerImport gets inserted.
Expected behavior
Special chars should be shown as the right char in Table ORVProtelCustomerImport and not as a "?"
Screenshots


Data:
Protel Debitoren.txt
5. Versions:
- Business Central:
Version: Platform 15.0.37395.0 + Application 15.0.36560.0
Describe the bug
If i use the AL-function UploadintoStream() then the Encoding of the Instream gets ignored. This means i cant change the Encoding, so if I import a file with german special characters like ß,ä,ö... cant get displayed in any Buisness Central table. I have this problem in BC15 SAAS-System.
To Reproduce
Use the function UploadIntoStream() to upload an ANSI-File wich has german letters to a stream.
If you load the data from the stream to a table, then german special characters are shown as a "?".
Code Example:
tempblob.CreateInStream(FileInstream, TextEncoding::Windows);
UploadIntoStream('Please chose a .txt import file', ImportFolder, 'txt files (.txt)|.txt', ImportFile, FileInstream);
CSVBuffer.DeleteAll();
CSVBuffer.LoadDataFromStream(FileInstream, ';');
IF CSVBuffer.FindSet() then
repeat
if (CSVBuffer."Field No." = 2) then
ORVProtelCustomerImport.Init();
case CSVBuffer."Field No." of
2:
begin
ORVProtelCustomerImport."Customer No." := FORMAT(DeleteBadChars(CSVBuffer.Value), 20);
IF Cust.Get(ORVProtelCustomerImport."Customer No.") then
ORVProtelCustomerImport."Customer exists" := true
else
ORVProtelCustomerImport."Customer exists" := false;
end;
4:
ORVProtelCustomerImport.Name := Format(DeleteBadChars(CSVBuffer.Value), 100);
5:
ORVProtelCustomerImport."Name 2" := Format(DeleteBadChars(CSVBuffer.Value), 50);
...
After filling the Values, ORVProtelCustomerImport gets inserted.
Expected behavior
Special chars should be shown as the right char in Table ORVProtelCustomerImport and not as a "?"
Screenshots


Data:
Protel Debitoren.txt
5. Versions:
4.0.191880
Version: Platform 15.0.37395.0 + Application 15.0.36560.0