mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 21:40:16 +02:00

modern Linuxes by a patch for UTF-8 console output. Previously, only BeOS used UTF-8. Tested with: - the linux console - xterm - gnome-terminal - konsole - rxvt-unicode using Fedora 11. Tested with - gnome-terminal - xterm - konsole using Ubuntu 9.04 Known "features": * high intensity colours were actually normal intensity, with a bold attribute set. This worked fine under gnome-terminal, but xterm didn't have bold versions of all cp437 characters, which screwed up the window borders in the IDE. And although konsole had them, I didn't like the font - it converted all the double window borders to a very thick single-line border. So I disabled the bolding of high intensity colours in all X11 terminals (TERM=xterm) and replaced it with another ANSI attribute, that actually sets high intensity colours, but is not (in theory) supported by all terminals. The linux console doesn't support it - it actually wants a bold attribute, to set high intensity, so that's why I enabled it only for X11 terminals. All the ones, that I tried, worked fine (xterm, gnome-terminal, konsole, rxvt-unicode, also the plain old rxvt, with a non-UTF-8 locale). * Fedora 11 by default uses a 512-characters font, called latarcyrheb-sun16 for the linux text mode console, which disables the high intensity colours, effectively reducing the set of available colours to only 8. This is a hardware limitation of the VGA hardware and can be avoided by using a 256-character font. It does not need to be cp437, but it has to have an unicode mapping. * I haven't tried other linux distros (and unix-like OSes, i.e. FreeBSD and Mac OS X) - although they should work in theory, they might look bad, due to different fonts, etc. git-svn-id: trunk@13651 -
74 lines
4.5 KiB
PHP
74 lines
4.5 KiB
PHP
const convert_linuxlowascii_to_vga:array[#0..#31] of word=(
|
|
$0020,$0001,$0002,$0003,$0004,$0005,$0006,$0007,
|
|
$00db,$0009,$00db,$000b,$006f,$0070,$006e,$002a,
|
|
$0010,$0011,$0012,$0013,$0014,$0015,$0016,$0017,
|
|
$0018,$0019,$001a,$0011,$001c,$001d,$001e,$001f
|
|
);
|
|
convert_lowascii_to_iso01:array[#0..#31] of word=(
|
|
$0020,$006f,$006f,$006f,$006f,$006f,$006f,$0020, { $00..$07 }
|
|
$f861,$006f,$f861,$0064,$006f,$0070,$006e,$002a, { $08..$0f }
|
|
$003e,$003c,$007c,$0021,$00b6,$00a7,$005f,$007c, { $10..$18 }
|
|
$0076,$005e,$003e,$003c,$f86d,$f86e,$005e,$0076 { $18..$1f }
|
|
);
|
|
convert_cp437_to_iso01:array[#128..#255] of word=(
|
|
$00c7,$00fc,$00e9,$00e2,$00e4,$00e0,$00e5,$00e7, { $80..$87 }
|
|
$00ea,$00eb,$00e8,$00ef,$00ee,$00ec,$00c4,$00c5, { $88..$8f }
|
|
$00c9,$00e6,$00c6,$00f4,$00f6,$00f2,$00fb,$00f9, { $90..$97 }
|
|
$00ff,$00d6,$00dc,$00a2,$00a3,$00a5,$0050,$0066, { $98..$9f }
|
|
$00e1,$00ed,$00f3,$00fa,$00f1,$00d1,$00aa,$00ba, { $a0..$a7 }
|
|
$00bf,$f86c,$00ac,$00bd,$00bc,$00a1,$00ab,$00bb, { $a8..$af }
|
|
$f861,$f861,$f861,$f878,$f875,$f875,$f875,$f86b, { $b0..$b7 }
|
|
$f86b,$f875,$f878,$f86b,$f86a,$f86a,$f86a,$f86b, { $b8..$bf }
|
|
$f86d,$f876,$f877,$f874,$f871,$f86e,$f874,$f874, { $c0..$c7 }
|
|
$f86d,$f86c,$f876,$f877,$f874,$f871,$f86e,$f876, { $c8..$cf }
|
|
$f876,$f877,$f877,$f86d,$f86d,$f86c,$f86c,$f86e, { $d0..$d7 }
|
|
$f86e,$f86a,$f86c,$f861,$f861,$f861,$f861,$f861, { $d8..$df }
|
|
$0061,$00df,$f86c,$f87b,$0053,$0073,$00b5,$0054, { $e0..$e7 }
|
|
$00d8,$0054,$004f,$0064,$0049,$00f8,$0065,$006e, { $e8..$ef }
|
|
$003d,$00b1,$f879,$f87a,$f878,$f878,$00f7,$00b1, { $f0..$f7 }
|
|
$00b0,$0078,$00b7,$0056,$006e,$00b2,$002a,$00a0 { $f8..$ff }
|
|
);
|
|
convert_cp850_to_iso01:array[#128..#255] of word=(
|
|
$00c7,$00fc,$00e9,$00e2,$00e4,$00e0,$00e5,$00e7, { $80..$87 }
|
|
$00ea,$00eb,$00e8,$00ef,$00ee,$00ec,$00c4,$00c5, { $88..$8f }
|
|
$00c9,$00e6,$00c6,$00f4,$00f6,$00f2,$00fb,$00f9, { $90..$97 }
|
|
$00ff,$00d6,$00dc,$00a2,$00a3,$00a5,$0050,$0066, { $98..$9f }
|
|
$00e1,$00ed,$00f3,$00fa,$00f1,$00d1,$00aa,$00ba, { $a0..$a7 }
|
|
$00bf,$f86c,$00ac,$00bd,$00bc,$00a1,$00ab,$00bb, { $a8..$af }
|
|
$f861,$f861,$f861,$f878,$f875,$00c1,$00c2,$00c0, { $b0..$b7 }
|
|
$00a9,$f875,$f878,$f86b,$f86a,$00a2,$00a5,$f86b, { $b8..$bf }
|
|
$f86d,$f876,$f877,$f874,$f871,$f86e,$00e3,$00c3, { $c0..$c7 }
|
|
$f86d,$f86c,$f876,$f877,$f874,$f871,$f86e,$00a4, { $c8..$cf }
|
|
$00f0,$00d0,$00ca,$00cb,$00c8,$0069,$00cd,$00ce, { $d0..$d7 }
|
|
$00cf,$f86a,$f86c,$f861,$f861,$00a6,$00cc,$f861, { $d8..$df }
|
|
$00d3,$00df,$00d4,$00d2,$00f5,$00d5,$00b5,$00fe, { $e0..$e7 }
|
|
$00de,$00da,$00db,$00d9,$00fd,$00dd,$00af,$00b4, { $e8..$ef }
|
|
$00ad,$00b1,$f879,$00be,$00b6,$00a7,$00f7,$00b8, { $f0..$f7 }
|
|
$00b0,$00a8,$00b7,$00b9,$00b3,$00b2,$002a,$00a0 { $f8..$ff }
|
|
);
|
|
convert_lowascii_to_UTF8:array[#0..#31] of WideChar=(
|
|
#8199,#9786,#9787,#9829,#9830,#9827,#9824,#8226,
|
|
#9688,#9675,#9689,#9794,#9792,#9834,#9835,#9788,
|
|
#9658,#9668,#8597,#8252,#0182,#0167,#9644,#8616,
|
|
#8593,#8595,#8594,#8592,#8735,#8596,#9650,#9660
|
|
);
|
|
convert_cp437_to_UTF8:array[#127..#255] of WideChar=(
|
|
#8962, { $7f }
|
|
#0199,#0252,#0233,#0226,#0228,#0224,#0229,#0231, { $80..$87 }
|
|
#0234,#0235,#0232,#0239,#0238,#0236,#0196,#0197, { $88..$8f }
|
|
#0201,#0230,#0198,#0244,#0246,#0242,#0251,#0249, { $90..$97 }
|
|
#0255,#0214,#0220,#0162,#0163,#0165,#8359,#0402, { $98..$9f }
|
|
#0225,#0237,#0243,#0250,#0241,#0209,#0170,#0186, { $a0..$a7 }
|
|
#0191,#8976,#0172,#0189,#0188,#0161,#0171,#0187, { $a8..$af }
|
|
#9617,#9618,#9619,#9474,#9508,#9569,#9570,#9558, { $b0..$b7 }
|
|
#9557,#9571,#9553,#9559,#9565,#9564,#9563,#9488, { $b8..$bf }
|
|
#9492,#9524,#9516,#9500,#9472,#9532,#9566,#9567, { $c0..$c7 }
|
|
#9562,#9556,#9577,#9574,#9568,#9552,#9580,#9575, { $c8..$cf }
|
|
#9576,#9572,#9573,#9561,#9560,#9554,#9555,#9579, { $d0..$d7 }
|
|
#9578,#9496,#9484,#9608,#9604,#9612,#9616,#9600, { $d8..$df }
|
|
#0945,#0223,#0915,#0960,#0931,#0963,#0181,#0964, { $e0..$e7 }
|
|
#0934,#0920,#0937,#0948,#8734,#0966,#0949,#8745, { $e8..$ef }
|
|
#8801,#0177,#8805,#8804,#8992,#8993,#0247,#8776, { $f0..$f7 }
|
|
#0176,#8729,#0183,#8730,#8319,#0178,#9632,#0160 { $f8..$ff }
|
|
);
|