Cygwin fails to utilize Unicode replacement character
Marco Atzeri
marco.atzeri@gmail.com
Wed Sep 5 13:18:00 GMT 2018
Am 05.09.2018 um 13:58 schrieb Steven Penny:
> On Wed, 5 Sep 2018 09:55:28, Corinna Vinschen wrote:
> Using this file:
>
> Â Â $ cat glyph.c
> Â Â #include <stdio.h>
> Â Â #include <windows.h>
> Â Â int main()
> Â Â {
> Â Â Â Â CONSOLE_FONT_INFOEX ta;
> Â Â Â Â ta.cbSize = sizeof ta;
> Â Â Â Â GetCurrentConsoleFontEx(GetStdHandle(STD_OUTPUT_HANDLE), 0, &ta);
> Â Â Â Â HDC wh = GetDC(0);
> Â Â Â Â SelectObject(wh,
> Â Â Â Â Â Â CreateFontW(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ta.FaceName));
> Â Â Â Â WCHAR xr[4] = {0xFFFD, 0x2592, 0x25A1, 0x01C4};
> Â Â Â Â WORD zu[4];
> Â Â Â Â GetGlyphIndicesW(wh, xr, 4, zu, 1);
> Â Â Â Â printf("%ls:\n", ta.FaceName);
> Â Â Â Â for (int q = 0; q < 4; q++) {
> Â Â Â Â Â Â printf("Â U+%04X: %s\n",
> Â Â Â Â Â Â xr[q], zu[q] == 0xffff ? "failure" : "success");
> Â Â Â Â }
> Â Â }
>
> I get this result:
>
> Â Â DejaVu Sans Mono:
> Â Â Â Â U+FFFD: success
> Â Â Â Â U+2592: success
> Â Â Â Â U+25A1: success
> Â Â Â Â U+01C4: failure
>
Strange on W10 CMD I obtain
DejaVu Sans Mono U+FFFD: failure
U+2592: failure
U+25A1: failure
U+01C4: failure
Consolas:
U+FFFD: failure
U+2592: success
U+25A1: success
U+01C4: success
May be original Windows "DejaVu Sans Mono" is incomplete ?
---
Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft.
https://www.avast.com/antivirus
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
More information about the Cygwin
mailing list