This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem with displaying ASCII table in mintty


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]