Character looks like ASCII 63 but isn't so I can't remove it

后端 未结 3 1472
情话喂你
情话喂你 2021-01-19 00:45

I\'m reading text from a text file. The first string the text file has to read is \"Algood \", and note the space. In Notepad, it appears that there is a space in this strin

3条回答
  •  离开以前
    2021-01-19 01:27

    It is the Unicode replacement character, U+FFFD, aka ChrW(&HFFFD).

    Never use Asc() or Chr(), they are legacy VB6 functions that do not handle Unicode. Passing a fancy Unicode codepoint to Asc() always produces 63, the character code for "?"c, aka "I have no idea what you're saying". The exact same idea as"�"c but using an ASCII code instead.

    Seeing the Black Diamond of Death back is always bad news, something went wrong when the string was converted from the underlying byte values. Because some byte values did not produce a valid character. Which is what you really should be looking for, you always want to avoid GIGO. Garbage In Garbage Out is an ugly data corruption problem that has no winners, only victims. You.

提交回复
热议问题