5

With all others characters HttpUtility works well but with this encoded value 𠮟 it just does not want to decode.

Decoded should be .

Image attached: http://screencast.com/t/r3TxPHrYr5

Jake Manet
  • 1,174
  • 3
  • 15
  • 26
  • Please clarify you want to decode html or ASCII of special character ? – Parasmani Batra Sep 28 '15 at 12:36
  • 1
    I guess `HttpUtility.HtmlDecode()` doesn't work with the character plane or Unicode version that `134047` was introduced in. See [this answer](http://stackoverflow.com/a/24515287/266143) to decode those entities to Unicode characters yourself (change the `2-5` to `2-6` though). – CodeCaster Sep 28 '15 at 12:36
  • Works fine for me... `Console.WriteLine(HttpUtility.HtmlDecode("𠮟"));` `System.Web.HttpUtility.HtmlDecode returned "" string` (Tested with .NET 4.6) – leppie Sep 28 '15 at 12:46
  • @CodeCaster - I am trying to decode the same code on a separate project and it works well. Both are using Framework 4.5.2 – Jake Manet Sep 28 '15 at 12:47
  • @leppie Looking at [the source](http://referencesource.microsoft.com/#System/net/System/Net/WebUtility.cs,bff894afbf9a1094,references), it works fine if you are targeting 4.5 or later. – Rawling Sep 28 '15 at 12:47
  • It looks like that 𠮟 is not found in previous versions of .net framework 4.5, however in a Console app it would give ??, except for 4.6 it works for somereason – Donald Jansen Sep 28 '15 at 13:03
  • Any other ideas? Why this decoding does not work? – Jake Manet Sep 29 '15 at 07:07

1 Answers1

1

Check to make sure that whatever font you're using to display the character has an associated glyph for that code point. Not all fonts have glyphs for all Unicode code points. Consolas, for one, has a relatively small set of glyphs, while Arial Unicode has glyphs for many of the defined Unicode code points. You can use the Character Map utility on Windows to verify that your font has a glyph for the code point in question. Fonts that don't have an associated glyph may either show nothing at all, a box with an X in it, a black diamond with a ? embedded within it (Firefox does this, I think), a ?, or even a ??.

HTH.

fourpastmidnight
  • 4,032
  • 1
  • 35
  • 48