Special characters in html output

前端 未结 3 821
既然无缘
既然无缘 2021-01-03 10:52

I want characters like \'ø\' to be printed directly, but in the source \'ø\' shows up as ø

If the output goes through Html.Encode()

3条回答
  •  温柔的废话
    2021-01-03 11:03

    AFAIK this is not possible unless you roll your own custom HTML encoding routine (which I absolutely would recommend you against).

    The resulting HTML is correct and the character is properly displayed on the client browser. HTML is meant to be read by programs (web browsers) in order to present it to a human readable form, not by humans.

  • Støvletter
  • is a perfectly valid HTML that will be displayed like this on the client browser:

    enter image description here

提交回复
热议问题