0

When I use Windowless RichEdit Controls(ITextHost, ITextServices), I found that if I enter an emoji such as , it will become □.

And if I use CreateWindowEx to create a RICHEDIT50W, all emoji is correct. But if create a RICHEDIT20W, enter emoji will become □.

Is Windowless RichEdit create RICHEDIT20W? How can I use Windowless RichEdit to create RICHEDIT50W?

rabbit
  • 33
  • 6
  • Emojis have high code points in Unicode and are probably missing in most other encodings. Without knowing details, I would suspect that `RICHEDIT20W` doesn't use any flavor of Unicode encoding or uses a font which hasn't glyphs for the code points in quest. My reading hint: [Minimum about Encodings](https://www.joelonsoftware.com/2003/10/08/the-absolute-minimum-every-software-developer-absolutely-positively-must-know-about-unicode-and-character-sets-no-excuses/) – Scheff's Cat Jan 30 '19 at 06:30
  • I googled [richedit20w unicode](https://www.google.com/search?q=richedit20w+unicode) and found (among others) the following which might be of interest: [SO: Unicode RTF text in RichEdit](https://stackoverflow.com/a/1782460/7478597). – Scheff's Cat Jan 30 '19 at 06:33
  • Can you enter this emoji in Notepad? Some Windows versions may not have the fall back font. – Barmak Shemirani Jan 30 '19 at 07:05
  • I enter into notepad and emoji is correct. I use spy++ and I guest notepad is use RICHEDIT50W. – rabbit Jan 30 '19 at 08:14
  • If I enter emoji, it will be incorrect, but if I use EM_SETTEXTEX, emoji can display correctly.(RICHEDIT20W) – rabbit Jan 30 '19 at 08:15
  • RichEdit20W is, is, is Unicode. That is what the W at the end of the class name signifies. – Joseph Willcoxson Jan 30 '19 at 14:54
  • Please show [Minimal Complete Verifiable Example](https://stackoverflow.com/help/mcve) – Barmak Shemirani Jan 30 '19 at 15:04
  • You can use `ITextServices` from `msftedit.dll` which is RichEdit 4.1 at least (depending on OS version). This is explained in [the docs](https://learn.microsoft.com/en-us/windows/desktop/controls/about-windowless-rich-edit-controls). – zett42 Jan 30 '19 at 23:28
  • I have used ITextServices from msftedit.dll – rabbit Jan 31 '19 at 04:01

1 Answers1

1

Having the same question, fixed by setting the font to "segeo UI Emoji"

Bill Wu
  • 11
  • 1