Cygwin fails to utilize Unicode replacement character

Thomas Wolff towo@towo.net
Wed Sep 5 09:22:00 GMT 2018


Am 05.09.2018 um 09:55 schrieb Corinna Vinschen:
> On Sep  4 04:40, Steven Penny wrote:
>> On Tue, 4 Sep 2018 11:00:00, Corinna Vinschen wrote:
>>> Whereever you get DejaVu Sans Mono from.
>> Cygwin provides it via the "dejavu-fonts" package, or you can get it here:
>>
>> http://dejavu-fonts.github.io
>>
>>> My W10 console only allows to specify a handful of fonts, Consolas, Courier
>>> New, Lucida, MS Gothic, NSimSun, Raster Fonts, SimSun-ExtB.
>> You can add DejaVu or others like this:
>>
>> http://superuser.com/questions/390933/add-font-cmd-window-choices/956818
> I added DejaVu Sans Mono per the above and to my surprise I see this:
>
>    $ cat alfa.txt
>    �
>
> So it looks like Deja Vu has a 0xfffd char.  However, GetGlyphIndicesW
> claims otherwise:
>
>    static const wchar_t replacement_char[3] =
>      {
>        0xfffd, /* REPLACEMENT CHARACTER */
>        0x25a1, /* WHITE SQUARE */
>        0x2592  /* MEDIUM SHADE */
>      };
>    WORD gi[3] = { 0, 0, 0 };
>    [...]
>    GetGlyphIndicesW (cdc, replacement_char, 3, gi, GGI_MARK_NONEXISTING_GLYPHS);
>    printf ("gi = %u %u %u\n", gi[0], gi[1], gi[2]);
>
> This prints:
>
>    gi = 65535 401 372
>
> That means, the notdef glyph for DejaVu looks like 0xfffd, but isn't, right?
I guess it means that (or something subtle related to font-fallback 
although we previously concluded the console wouldn't support it...).
My vote remains for going back to MEDIUM SHADE, for 2.11.2 then..., 
unless we find a working detection function.
Thomas

--
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