How to encode characters in Web.Config by Unicode value

ASP.net uses the WEB.CONFIG file with the appSettings section; I am trying to save some string variables. One of them is a string containing non-breaking space (Unicode 00A0 hexadecimal value), and the other is an empty string.

I think this is something like "# & FFFF" for unicode, but cannot find any guidance on this. In addition, the WEB.CONFIG file does not look like an empty line.

I have a workaround for this, but it would be great to know how to store Unicode characters or blank lines in a configuration file.

+2
source share
1 answer

Web.config is XML, so follow the XML standard

<add key="Test" value="&#xa0;" />

+2
source

Source: https://habr.com/ru/post/1247662/


All Articles