c# - How to allow unicode characters in web.config for my MVC application? -


i wanted add cool characters names , added in web.config picture of cow, this.

<add key="sendername" value="&#x1f3eb; mr mooo"/> 

however, when start application, exception on line in _layout.cshtml nagging localization , such.

@styles.render("~/content/css") 

i'm not sure how handle this. apparently, mvc hates cows can it?

i've tried follow the suggested syntax according standard. added utf-16 @ top of config file.

this has nothing @ unicode characters , xml escaping.

as stated in xml standard linked to, xml defines 5 standard entities:

  • < represents "<";
  • > represents ">";
  • & represents "&";
  • ' represents "'";
  • " represents '"'.

all other entities (such &#x1f3eb;) not valid in xml unless explicitly define them.

there easy way out of situation, though. problem entity contains ampersand not escaped, makes incompatible xml. need escape , right world.

<add key="sendername" value="&amp;#x1f3eb; mr mooo"/> 

now application receive unescaped string want: &#x1f3eb; mr mooo when retrieve config file, , can pass on view.


Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -