Web CSV export encoding problem

We are using fastreport 2024.1.7 and asp.net core 6.0. When we are exporting Csv file from web toolbar, then turkish character not shown in excel document. it exports different characters. we test turkish windows and debian operating systems. we set webreport LocalizationFile Turkish.frl. Toolbar language change turkish, but not export Turkish Language. By the way no problem export PDF, Excel and Word documents. Where is toolbar csv export button click taken language from? 

we tested tr_TR.ISO-8859-9 and tr_TR.UTF-8 linux configurations;

# locale  

LANG=tr_TR.ISO-8859-9

LANGUAGE=tr

LC_CTYPE="tr_TR.ISO-8859-9"

LC_NUMERIC="tr_TR.ISO-8859-9"

LC_TIME="tr_TR.ISO-8859-9"

LC_COLLATE="tr_TR.ISO-8859-9"

LC_MONETARY="tr_TR.ISO-8859-9"

LC_MESSAGES="tr_TR.ISO-8859-9"

LC_PAPER="tr_TR.ISO-8859-9"

LC_NAME="tr_TR.ISO-8859-9"

LC_ADDRESS="tr_TR.ISO-8859-9"

LC_TELEPHONE="tr_TR.ISO-8859-9"

LC_MEASUREMENT="tr_TR.ISO-8859-9"

LC_IDENTIFICATION="tr_TR.ISO-8859-9"

LC_ALL=trTR.ISO-8859-9

Comments

  • I think you should check this settings.



  • Hello!

    To resolve your issue, if you are using your own endpoint / CSVExport, pass `Encoding.UTF8` (or `Encoding.GetEncoding(1254)` with a BOM for older versions of Excel; in .NET Core, you need to use `Encoding.RegisterProvider(CodePagesEncodingProvider.Instance)`).

    Also, in WebReport, add an export handler or a custom download button that returns UTF-8 with a BOM prefix (0xEF, 0xBB, 0xBF — Encoding.UTF8.GetPreamble()) so that Excel automatically recognises UTF-8.

This discussion has been closed.