06-15-2020 01:57 AM
Is there a way to alter the default text encoding of a CSV file, created by DESKTOP app's query result? Maybe a workaround?
06-15-2020 02:21 AM
I believe the Query API response is encoded in UTF-8 - isn't that enough for your needs? If you see incorrect characters, then maybe, they're encoded in the database improperly, or the Query API backend doesn't work with the character set correctly...
Thus my question - what is your observation? What is expected to see?
Also, make sure that Query API CSV response is to blame here, it could be, that the UTF-8 characters are not just correctly shown by the client which uses the Query API. You can use browser developer tools and see what you get in the query response.
06-16-2020 02:25 AM
Thank you for the answer.
What I observed is that the output encoding of the CSV varies according to OS locale\language, which is OK. For me it came as Windows-1255 and UTF-8 encoding for two different OS - Windows 2012 Server R2 and Windows 10 respectively.
What I wanted to know, if there's a known way or workaround to define the output's encoding other than changing OS locale\language?
06-16-2020 02:57 AM
Hmm, not sure if this is easily configurable, but you can possibly try to force globalization in the web.config:
<globalization requestEncoding="UTF-8" responseEncoding="UTF-8" fileEncoding="UTF-8" />
06-23-2020 02:20 AM
This seems like a real nice workaround but I need some more instructions in order to apply it:
Thank's so far.
06-30-2020 05:30 AM
I'm not fully certain if it will work, but you can try it...
Please check the MSDN docs about this tag: https://docs.microsoft.com/en-us/dotnet/api/system.web.configuration.globalizationsection?view=netfr...
It is expected to be located anywhere in the <system.web> node.
<system.web> <globalization requestEncoding="utf-8" responseEncoding="utf-8"/> </system.web>
It should go to the web.config file in the root of MAE installation. After modifying the web.config, the application pool will recycle automatically.
3 weeks ago
Unfortunately, adding this parameters to the 'web.config' file didn't seem to set the encoding of the output CSV. The CSV's encoding is still determind, as far as I understand, by the OS.
Thank you for the effort.