@ ollydbg
This change didn't work for me. (Message #69)
I want the codepoint. I don't get any asserts.
With "wxUniChar uniChar(invChar);" I get:
Error: Removed clangd response invalid utf8 char:position(3665), hex(85), U(2026), <cant post> ResponseID:textDocument/completion
Note that I get the codepoint U(2026) back.
With "wxUniChar uniChar(unsigned int(invChar));" I get:
Error: Removed clangd response invalid utf8 char:position(6899), hex(85), U(85), ,<cant post on sf>. ResponseID:textDocument/completion
Here I get only the hex value.
So I changed the wxString::Format to:
msg += wxString::Format("position(%d), hex(%02hhX), U(%x), \'%s\'", invloc, (unsigned int)invChar, (int)uniChar.GetValue(), invStr );
Note the "(int)uniChar.GetValue()"
I'm using wx3.1.5 on windows and wx3.0 on linux.
Works with no asserts.
Does it work for you
In my computer, it works differently than yours.
I did a simple test:
unsigned char invChar = 0x83;
wxUniChar uniChar(invChar);
wxString msg = wxString::Format("hex(%02hhX), U(%x)", (unsigned int)invChar, uniChar.GetValue());
wxLogMessage(msg);
With the above code, the program just pop up an alert (see screen shot in attachment)
While, with below code, it works OK without the alert.
unsigned char invChar = 0x83;
wxUniChar uniChar((unsigned int)invChar);
wxString msg = wxString::Format("hex(%02hhX), U(%x)", (unsigned int)invChar, uniChar.GetValue());
wxLogMessage(msg);
Please note that "Create a character from the 8-bit character value c using the current locale encoding.", which means in my locale encoding, a 0x83 is not a valid Unicode code point, I mean maybe we need two bytes or three bytes to convert it to a Unicode code point.
I'm not sure why in your test case, a 0x83 will becomes a larger value code point U(2026). Maybe, you have different locale encoding as mine. I'm on Windows 7 64bit Chinese language edition, so my local encoding maybe some Chinese language.
Note: it took me 45 minutes to post this. Don't try and post a msg with an invalid utf8 char. It's a PITA
I also meet this kind of forum error from time to time. So bad.