Problem with displaying ASCII table in mintty

Andy Koppe andy.koppe@gmail.com
Fri Jun 26 08:49:00 GMT 2009


2009/6/26 Mark Harig
>
> Is is possible to display the upper 128 entries in the ASCII
> table in mintty using the 'cygutils' application 'ascii'?
>
> I have attempted to use two configurations, but neither one
> displays the table without problems in mintty:
>
> Configuration 1:
>
>   - mintty: Using the font's codepage set to UTF-8
>
>     bash-3.2$ /usr/bin/grep Codepage ~/.minttyrc
>     Codepage=UTF-8
>
>   - bash:
>     bash-3.2$ echo $TERM
>     xterm
>
>    bash-3.2$ echo \"$LANG\" ":" \"$LC_ALL\" ":" \"$LC_CTYPE\"
>     "en_US.UTF-8" : "en_US.UTF-8" : "en_US.UTF-8"
>
>  With this configuration, the upper 128 entries to the ASCII
>  table are displayed as follows (the #'s are replacements for
>  the gray box character that is displayed):

That's because because bytes from 0x80 to 0xFF by themselves are
invalid in UTF-8. Those codepoints need to be encoded as two-byte
sequences. I'd suspect /bin/ascii isn't designed for that.


Configuration 2:
>
>   - mintty: Using the font's codepage set to ISO-8859-1
>
>     bash-3.2$ /usr/bin/grep -i codepage ~/.minttyrc
>     Codepage=ISO-8859-1:1998 (Latin-1, West Europe)
>
>  - bash:
>
>    bash-3.2$ echo \"$LANG\" ":" \"$LC_ALL\" ":" \"$LC_CTYPE\"
>    "en_US.ISO-8859-1" : "en_US.ISO-8859-1" : "en_US.ISO-8859-1"
>
>  With this second configuration, most of the upper 128 entries
>  of the ASCII table are displayed, but many are missing.

What's missing are the characters from 0x80 to 0x9F, aka the C1
control character set in the ISO codepages. Windows codepages have
printable characters in their place.

>  In addition,
>  many entries are displayed in the wrong location (some rows are out
>  of order).

That's because some of the C1 control characters are interpreted
specially, in particular CSI and OSC. It's the same if you try it in
xterm.

You can get most of the printable characters in the C1 range by
switching to Windows codepage 1252. (Well, you could anyway if it
wasn't for a rather bad bug in mintty-0.4.0 and 0.4.1 that means that
ISO-8859-1 is used no matter your codepage setting. That's fixed on
the 0.4 SVN branch.)

Andy

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