Changes to the internal usage of unicode areas for character set conversion.

The unix port is using the U+D800 range for the same jobs as the windows
port uses the U+F100 range. Set it to use the same range of characters.

Note: unlike windows this is ONLY used if the font doesn't have a
recognised character set so this change doesn't make the DTF range
compatible with the Linux console.

In a similar issue terminal.c is using the CSET_* codes for two different
tasks; the screen map characters and the line characters. Making the
distinction explicit should clarify things.

We now have a 32bit space for the characters so the hack of placing
the CSET_* code overlapping the surrogates is no longer required. We
can instead place them past the end of the valid unicode characters
(ie U+180000). Note I've chosen 0x180000 rather than 0x200000 to preserve
the compression of the scrollback.

Unfortunatly I can't do the same for the DTF range as it wouldn't work
for the UTF-16 platform. I can, however, move it to the "Low Surrogates"
area where it shouldn't interfere with the normal use of surrogates.

Added Linux DTF range (U+F000 -> CP437) explicitly into the emulation
because we no longer have the "happy coincidence" of the OEMCP being
mapped to U+F000. This means it could now be disabled for pure utf8 mode.
Clean up VT52 leftovers from the 256 colours patch

Some references to the unused flag vt52_bold are removed.
Also remove the messing with the 'blink_is_real' flag that isn't
needed with the 256 colour implementation as we have more than
eight stable background colours.
Add wcwidth override sequence

ECMA-48: 8.3.90 PEC - PRESENTATION EXPAND OR CONTRACT

CSI Pn SP Z used for character width override.
	Only applies to characters that are not in US-ASCII.
	Does not work with DBCS fonts, only unicode conversion.

    Pn=0   Default
    Pn=1   Force Wide for unicode chars.
    Pn=2   Force narrow for unicode chars.
    Pn=5   Force one Wide unicode char.
    Pn=6   Force one narrow unicode char.

This allows the host to do a DBCS to UTF-8 conversion and keep the
anachronistic alphabetic artifacts of the original encoding.
Add Ansi REP sequence and SCO CSI = g

ECMA-48: 8.3.103 REP - REPEAT
    Notation: (Pn)
    Representation: CSI Pn 06/02
    Parameter default value: Pn = 1

CSI = Pn g
    Display the number Pn as the character from the selected font.
    For 0..255 this is does as the CP437 VGA ROM set, for 256 and
    above it is a unicode character number.

This change requires the literal character print routine to be called
from more than one location so that code has been extracted into a
distinct function. Pragmatically this is a long overdue change to help
reduce the size of the huge term_out function.
Readme for github

A .gitignore file and a working makefile with proper cleanup
Add DIM, CONCEAL and BGBOLD

CSI 2 m	    Set screen colour to dim
CSI 8 m	    Hide the character printed by making the normal display
	    just the background colour. If the text is selected the
	    text is shown
CSI 6 m	    With the advent of 256 colours the SCO Unix bright background
	    sequence can now be implemented using a distinct flag,
	    it doesn't override the 'blink_is_real' flag.

The text blinking can be set to use various styles, including the strident
PC styles and the more civilised Wyse style.

Note: The configuration for the Text blink style is disabled on Windows
because it makes the config box too big. I suggest bringing Window and
Unix into line by giving the Windows configuration a Fonts tab.
UTF8 Update
This patch adds ANSI.SYS, SCO Xenix 2.3.2 and a general ANSI emulation.

The SCO Xenix is a well defined but rather old style emulation similar
in many respects to the ANSI.SYS emulation but a bit nicer. The later
SCO Unix variants are far more uncertain as they cover may versions of
SCO Unix where the emulation was changed to maintain or provide minimal
compatibility with other systems.

In the SCO Xenix emulation I have assumed the mapchan(1) facility has
been used to set the default character set to the putty line codepage. So
if your application assumes the mapchan process hasn't been run you will
need to set the line charset to CP437. The ANSI.SYS emulation forces CP437.

echo -e '\e[4040"p'   # Set normal PuTTY (xterm) mode.
echo -e '\e[4041"p'   # Set modern Ansi mode, all available non VT sequences.
echo -e '\e[4042"p'   # Set ANSI.SYS emulation
echo -e '\e[4043"p'   # Set SCO Xenix

echo -e '\e[4030"p'   # Set pure VT52 mode
echo -e '\e[4031"p'   # Set pure VT220+ mode

These and all the compatibility stuff can be turned off using the compile
option DISABLE_COMPAT. Note, CSI 4030"p turns off _nearly_ all the CSI
sequences, the exception being ones that begin "ESC [ 404".
The SCO emulation overrides the configured function key definitions.

The SCO Xenix emulation does not have the reverse or graphic attribute
variables. However, I do have full details if these are needed.

Attributes DIM and CONCEAL have been added. Concealed text is shown by
highlighting it with the mouse.

Altered CSI 21m to be dup of CSI 22m; I didn't know about this convention
when I chose to use single underline as a near enough equlivent to
double underline.

The SCO ACS character set on unix has been fixed; added the OEM glyphs
for characters 1..31.
The default SCO mapping for the number pad '5' key has been fixed.
The ECMA-48 'REP' code, repeat character has been added.
I've added SCO's new CSI 13m mode and the CSI=g code.
Removed the supposedly SCO CSI 6m.
Linux CSI 8 ] for default colours. CSI 8 ; 1 ] to reset.
Added CSI 8 ; 2 ] to reconfigure the default colours and the BLINK
attribute to blink any other attribute.

In ANSI.SYS mode CSI-J homes cursor.

Added XTerm's vttest modes; CSI ?40 l/h & CSI ?45 l/h
    This means DECCOLM is disabled by default and stops xterm's "tput init"
    clearing the screen.

Default blink now to DIM not blank, set with:
   echo -e '\e[0;2m\e[8;2]\e[m'
Set back to PC Style with:
   echo -e '\e[0;8m\e[8;2]\e[m'

I haven't added GUI configs for any of this; don't know which you'd prefer.
    Possibilities:
	Terminal Type: xterm/ansi/ansisys/scoansi/vt220/vt52
	Blink attribute: Dim/Conceal/Reverse ...

I've had to move the literal character display into it's own function
so I can call it from multiple places.

Readded Linux DTF range (U+F000 -> CP437) explicitly into the emulation.
This means I no longer need the "happy coincidence" of the OEMCP being
mapped to U+F000.

Cleaned out "vt52_bold" variable; it does nothing.

Some small updates to the emulation.

Added a config and setting to control the text blinking style then removed
the CSI sequence.

Some cleanups to the emulation switching.

UTF8 as a line codepage is supported better now.
UTF8 locking is gone completely; use the no_remote_charset_switching
Follow the locale in a slightly different way

The config dialog works on windows, but it's too big.
Adding better support for Windows MBCS (codepages)

Adding better support for some 国家标准 character sets. (ie Chinese standard
character sets), Japanese, Korean and Thai.  Including the Shift-JIS variants.

The characters are displayed at the expected widths.

This does NOT need a specific font as long as the unicode system can find the
requsite characters.

Note the change in the defaults; it is now recommended to explicitly
specify the line character set for DBCS systems.

Also added these Windows charsets to the list.

Unlike DBCS fonts this can be made to work for the Unix port as it only
requires Codepage to Unicode character and width tables.
Reconfigure PuTTY colour scheme from Unix host.

This is possibly related to: /wishlist/colour-scheme.html

These colour schemes are not stored in the PuTTY session file but are
instead "dynamically" configured from the host.

This script can send the required control sequences suitable for any
modern version of PuTTY or the Linux console.

It can calculate several standard forms and contains a default PuTTY
and XTerm mappings. In addition it can the colour scheme from a Windows
PuTTY registry dump, a Unix session file or something similar.
DEBUG messages for tracing