What does it mean when my text is displayed as Question Marks?

前端 未结 3 1202
面向向阳花
面向向阳花 2020-12-03 15:30

I\'m attempting to display some text in my program using (say) Windows GDI and some of the unicode characters are displayed as question marks? What is up?

See also:

3条回答
  •  旧时难觅i
    2020-12-03 16:09

    Basically you have corrupted the text. You are taking Unicode text in one encoding and then have converted it to another encoding without checking that target encoding includes all of the characters in the source text. Having done so you have got a bunch of gibberish.

    Ways to do this include:

    1. Treating UTF-8 text as ANSI (without converting into a valid code-page first)
    2. Converting Unicode text into a code-page without checking if the code-page has the right characters in it.

提交回复
热议问题