Is it possible to display (convert?) In unicode hex \ u0092 into a unicode html object in .NET?

I have a line containing the following code / value:

"You won\u0092t find a ...."

enter image description here

It looks like this line contains the special character Right Apostrophe.

I am not sure how to display this on a web browser. Instead, it displays the TOFU square-square symbol. I get the impression that the unicode (hex) value 00092can be converted to unicode (html)’

Do I understand correctly?


Update 1:

It was suggested by @ sam-ax that I am HtmlEncode unicode. This did not work. Here it is...

enter image description here

Please note that you ampersandreceived the correct encoding ....

+4
2

, . .NET UTF-16, \u2019. \x92, , Windows 1252. Unicode, \x92 .

, UTF-16. , Unicode 1252:

string title = "You won\u0092t find a cheaper apartment * Sauna & Spa";
byte[] bytes = title.Select(c => (byte)c).ToArray();
title = Encoding.GetEncoding(1252).GetString(bytes);
// Result: "You won’t find a cheaper apartment * Sauna & Spa"
+3

. System.Web 4.0. (?).

, "’" (6 ). "\u0092" (1 ). , HTML.

WebUtility.HtmlEncode() 128 160 - ( , HTML-).

, , , , . ( LinqPad, .)

( ), , , / HtmlEncode() - -, , .

, .

: . , , .

+1

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


All Articles