0

I'm trying to design a virtual keyboard with character of any language. Everything goes fine, except one point: codes beyond 0xFFFF. I'm using surrogate pairs for codes beyond 0xFFFF, like this:

Dim codeH As Integer
Dim codeL As Integer

If thisCode > 65535 Then
    thisCode = (thisCode - &H10000)
    codeH = &HD800 + (thisCode >> 10)
    codeL = &HDC00 + (thisCode And &H3FF)
    Return (ChrW(codeH) + ChrW(codeL))
Else
    Return ChrW(thisCode)
End If

But as soon I'm using the result as a string to display on a control (richTextBox, label, button, whatever...), all I get is a square or a blank character.

Of course I tried several fonts, even Arial Unicode MS, but I'm still stuck with my squares...

What am I missing ? Any solution ?

Ňɏssa Pøngjǣrdenlarp
  • 38,411
  • 12
  • 59
  • 178
C. MARIN
  • 95
  • 9
  • Great. Now I'm aware about That I'd better ask for a solution rather than an idea, what would be your idea about the solution? – C. MARIN Aug 25 '17 at 19:14
  • 1
    [FileFormat.Info](http://www.fileformat.info/info/unicode/char/1F6B2/fontsupport.htm) might be helpful to identify which fonts support the codepoint in question. But, I doubt you find anything other than a fallback font that support every codepoint to the current Unicode specification. – Tom Blodget Aug 26 '17 at 18:22
  • This, seems to be quite helpful, thanks Tom. I'm afraid you're right, it seems to be hard to find fonts with a good coverage for codepoints beyond 0xFFFF. – C. MARIN Aug 26 '17 at 21:55

0 Answers0