0

I generate web-page by Razor and sometimes browser show me question marks instead of one random unicode character.

For example:

screenshot

I think, this question mark is displayed in place where the first byte of two-byte unicode character is in the one tcp-package and the second byte of character in the other tcp-package. But why browser does't paste them correctly?

All files encoded by utf-8. There is <meta charset="utf-8">.

Update

Question marks dependent on page content. If I change content before question mark, it may disappear or move to other place (replace other character)

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
Almeonamy
  • 23
  • 9
  • Without seeing the actual bytes being transmitted, it is hard to diagnose this. It could be a font issue, like Afzaal described, or it could really be an encoding issue, if the HTML is not properly UTF-8 encoded. But one thing is certain - if the start bytes of a multibyte-encoded character are in one TCP packet, and the end bytes of the same sequence are in the next TCP packet, that will NOT break any web browser at all. TCP is just a raw data transport, it can break up bytes however it wants on the wire. The actual conversion of bytes into characters is handled separately. – Remy Lebeau Mar 20 '15 at 23:13
  • How I can get this bytes? – Almeonamy Mar 24 '15 at 12:16

1 Answers1

0

Encoding the characters in UTF-8 encoding scheme is not the only thing you should consider while working with encodings. Font family also plays a great role in this thing for rendering the correct graphics for all of your characters; characters are after all just glyph drawn by graphics. Unicode takes care of all of the bytes (1, 2, 3, 4 which ever size) of your characters and shows the correct character on your screen; if your framework or font-family supports the glyph.

In your website, the font-family; probably a custom loaded, does not support this character, (or the code page to be more specific) that is why browser has to fall-back to display a question mark. You're also saying that the character is randomly chosen, so that defines the problem, for being a font-family based problem. I would advise that you try out your application in 'Segoe UI' font-family and see if that works; because that probably would work.

Apart from my suggestion, please make sure that the font-family does support that code page where this character exists. Otherwise, it will display a question mark.

Afzaal Ahmad Zeeshan
  • 15,669
  • 12
  • 55
  • 103
  • Font family is Open Sans. I tryed use other font family: same result. Brower displays same characters in other places corretly. [Example](https://dl.dropboxusercontent.com/u/33356150/Screenshot2.PNG). On this page character К displays as question mark only once. – Almeonamy Mar 19 '15 at 09:30