1

In my app some UTF characters like – whose value is UC2-Decimal(150),UC2-Hex(0096),UTF8-Hex(C296) which is fetched from some website, cannot be displayed properly in the browser. It displays some unwanted characters.

Can anyone help me on this?

Lieven Keersmaekers
  • 57,207
  • 13
  • 112
  • 146
rkhm
  • 181
  • 2
  • 3
  • 16

1 Answers1

1

I have no idea what UC2-Decimal and UC2-Hex mean, but you seem to be talking about Unicode code point 150 (decimal) or 0x96 (hex). This Unicode character exists but it isn't what you are looking for: it's an obscure control character in the C1 series known as "SPA". Presumably this is the problem!

The character which you actually copied in your question is U+2013, known as "EN DASH", a valid character. Its UTF-8 representation would be the three-byte sequence 0xe2 0x80 0x93.

Celada
  • 21,627
  • 4
  • 64
  • 78
  • Yeah am talking about Unicode point 150(decimal).This charecter gets displayed as some junk charecter in my app.How do i handle it in app – rkhm Feb 08 '12 at 08:46
  • You don't. U+0096 (decimal 150) is not the character you are looking for. I misspoke when I said it didn't exist (I will correct my answer in just a minute) but it's an obscure unprintable control character known as SPA. [Here](http://www.unicode.org/charts/PDF/U0080.pdf) is the official reference. – Celada Feb 08 '12 at 16:35
  • Worth noting that OP probably wanted to refer to UCS-2, used by default in SQL Server ([source](https://stackoverflow.com/questions/9008043/ucs-2-and-sql-server)). – OfirD Apr 03 '20 at 09:57