Commit 494c42d0 authored by Alexandre Julliard's avatar Alexandre Julliard

libwine: Hardcode the data for the US-ascii codepage instead of loading a unicode.org file.

parent d6d6ce29
/* code page 20127 (US-ASCII (7bit)) */
/* generated from ftp.unicode.org/Public/MAPPINGS/VENDORS/MISC/US-ASCII-QUOTES.TXT */
/* DO NOT EDIT!! */
#include "wine/unicode.h"
......@@ -10,7 +9,7 @@ static const WCHAR cp2uni[256] =
0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f,
0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017,
0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f,
0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x2019,
0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027,
0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f,
0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f,
......@@ -18,26 +17,26 @@ static const WCHAR cp2uni[256] =
0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f,
0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057,
0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f,
0x2018, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067,
0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067,
0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f,
0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f,
0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
0x003f, 0x003f, 0x003f, 0x003f, 0x00a4, 0x003f, 0x003f, 0x00a7,
0x003f, 0x003f, 0x003f, 0x003f, 0x00ac, 0x003f, 0x003f, 0x003f,
0x00b0, 0x00b1, 0x003f, 0x003f, 0x00b4, 0x003f, 0x00b6, 0x00b7,
0x003f, 0x003f, 0x003f, 0x003f, 0x00bc, 0x00bd, 0x00be, 0x00bf,
0x003f, 0x003f, 0x003f, 0x003f, 0x003f, 0x003f, 0x003f, 0x003f,
0x003f, 0x003f, 0x003f, 0x003f, 0x003f, 0x003f, 0x003f, 0x003f,
0x003f, 0x003f, 0x003f, 0x003f, 0x003f, 0x003f, 0x003f, 0x003f,
0x003f, 0x003f, 0x003f, 0x003f, 0x003f, 0x003f, 0x00de, 0x00df,
0x003f, 0x003f, 0x003f, 0x003f, 0x003f, 0x003f, 0x003f, 0x003f,
0x003f, 0x003f, 0x003f, 0x003f, 0x003f, 0x003f, 0x003f, 0x003f,
0x003f, 0x003f, 0x003f, 0x003f, 0x003f, 0x003f, 0x003f, 0x00f7,
0x003f, 0x003f, 0x003f, 0x003f, 0x003f, 0x003f, 0x00fe, 0x003f
0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007,
0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f,
0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017,
0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f,
0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027,
0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f,
0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f,
0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047,
0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f,
0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057,
0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f,
0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067,
0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f,
0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f
};
static const unsigned char uni2cp_low[4608] =
......@@ -47,7 +46,7 @@ static const unsigned char uni2cp_low[4608] =
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x3f,
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
......@@ -55,26 +54,26 @@ static const unsigned char uni2cp_low[4608] =
0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
0x50, 0x51, 0x52, 0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 0x41, 0x41, 0x41, 0x43,
0x45, 0x45, 0x45, 0x45, 0x49, 0x49, 0x49, 0x49,
0x44, 0x4e, 0x4f, 0x4f, 0x4f, 0x4f, 0x4f, 0x78,
0x4f, 0x55, 0x55, 0x55, 0x55, 0x59, 0xde, 0xdf,
0x4f, 0x55, 0x55, 0x55, 0x55, 0x59, 0x3f, 0x3f,
0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x63,
0x65, 0x65, 0x65, 0x65, 0x69, 0x69, 0x69, 0x69,
0x64, 0x6e, 0x6f, 0x6f, 0x6f, 0x6f, 0x6f, 0xf7,
0x6f, 0x75, 0x75, 0x75, 0x75, 0x79, 0xfe, 0x79,
0x64, 0x6e, 0x6f, 0x6f, 0x6f, 0x6f, 0x6f, 0x3f,
0x6f, 0x75, 0x75, 0x75, 0x75, 0x79, 0x3f, 0x79,
/* 0x0100 .. 0x01ff */
0x41, 0x61, 0x41, 0x61, 0x41, 0x61, 0x43, 0x63,
0x43, 0x63, 0x43, 0x63, 0x43, 0x63, 0x44, 0x64,
......@@ -132,9 +131,9 @@ static const unsigned char uni2cp_low[4608] =
0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f,
0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f,
0x68, 0x3f, 0x6a, 0x72, 0x3f, 0x3f, 0x3f, 0x77,
0x79, 0x3f, 0x22, 0x60, 0x27, 0x3f, 0x3f, 0x3f,
0x79, 0x27, 0x22, 0x60, 0x27, 0x3f, 0x3f, 0x3f,
0x3f, 0x3f, 0x3f, 0x3f, 0x5e, 0x3f, 0x5e, 0x76,
0x3f, 0x2d, 0x3f, 0x3f, 0x3f, 0x5f, 0x3f, 0x3f,
0x27, 0x2d, 0x27, 0x60, 0x3f, 0x5f, 0x3f, 0x3f,
0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f,
0x3f, 0x3f, 0x3f, 0x3f,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3f, 0x3f, 0x3f, 0x27, 0x3f, 0x3f, 0x3f,
0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3b, 0x3f,
0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x22, 0x41, 0x3f,
0x3f, 0x3f, 0x3f, 0x3f, 0x27, 0x22, 0x41, 0x3f,
0x45, 0x48, 0x49, 0x3f, 0x4f, 0x3f, 0x59, 0x3f,
0x3f, 0x41, 0x42, 0x3f, 0x3f, 0x45, 0x5a, 0x48,
0x3f, 0x49, 0x4b, 0x3f, 0x4d, 0x4e, 0x3f, 0x4f,
......@@ -270,9 +269,9 @@ static const unsigned char uni2cp_low[4608] =
0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f,
0x49, 0x49, 0x49, 0x49, 0x3f, 0x3f, 0x3f, 0x3f,
0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f,
0x59, 0x59, 0x59, 0x59, 0x50, 0x22, 0x22, 0x3f,
0x59, 0x59, 0x59, 0x59, 0x50, 0x22, 0x22, 0x60,
0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f,
0x4f, 0x4f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f,
0x4f, 0x4f, 0x3f, 0x3f, 0x3f, 0x27, 0x3f, 0x3f,
/* 0x2000 .. 0x20ff */
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f,
......@@ -280,7 +279,7 @@ static const unsigned char uni2cp_low[4608] =
0x60, 0x27, 0x2c, 0x60, 0x22, 0x22, 0x2c, 0x3f,
0x3f, 0x3f, 0x3f, 0x3f, 0x2e, 0x3f, 0x3f, 0x3f,
0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x20,
0x3f, 0x3f, 0x3f, 0x22, 0x3f, 0x60, 0x3f, 0x3f,
0x3f, 0x3f, 0x27, 0x22, 0x3f, 0x60, 0x3f, 0x3f,
0x3f, 0x3c, 0x3e, 0x3f, 0x21, 0x3f, 0x2d, 0x3f,
0x3f, 0x3f, 0x3f, 0x3f, 0x2f, 0x3f, 0x3f, 0x3f,
0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f,
......@@ -571,7 +570,7 @@ static const unsigned char uni2cp_low[4608] =
0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f,
0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f,
/* 0xff00 .. 0xffff */
0x3f, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x3f,
0x3f, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
......@@ -579,7 +578,7 @@ static const unsigned char uni2cp_low[4608] =
0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
0x3f, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x3f,
......
......@@ -80,7 +80,7 @@ $DEF_CHAR = ord '?';
[ 10029, "VENDORS/MICSFT/MAC/LATIN2.TXT", "Mac Latin 2" ],
[ 10079, "VENDORS/MICSFT/MAC/ICELAND.TXT", "Mac Icelandic" ],
[ 10081, "VENDORS/MICSFT/MAC/TURKISH.TXT", "Mac Turkish" ],
[ 20127, "VENDORS/MISC/US-ASCII-QUOTES.TXT", "US-ASCII (7bit)" ],
[ 20127, undef, "US-ASCII (7bit)" ],
[ 20866, "VENDORS/MISC/KOI8-R.TXT", "Russian KOI8" ],
[ 20932, "OBSOLETE/EASTASIA/JIS/JIS0208.TXT", "EUC-JP" ],
[ 21866, "VENDORS/MISC/KOI8-U.TXT", "Ukrainian KOI8" ],
......@@ -370,9 +370,6 @@ sub READ_FILE
{
my $name = shift;
open INPUT,$name or die "Cannot open $name";
@cp2uni = ();
@lead_bytes = ();
@uni2cp = ();
while (<INPUT>)
{
......@@ -402,15 +399,21 @@ sub READ_FILE
################################################################
# fill input data for the 20127 (us-ascii) codepage
sub fill_20127_codepage()
{
for (my $i = 0; $i < 128; $i++) { $cp2uni[$i] = $uni2cp[$i] = $i; }
for (my $i = 128; $i < 256; $i++) { $cp2uni[$i] = $i & 0x7f; }
}
################################################################
# build EUC-JP table from the JIS 0208 file
# FIXME: for proper EUC-JP we should probably read JIS 0212 too
# but this would require 3-byte DBCS characters
sub READ_JIS0208_FILE
{
my $name = shift;
@cp2uni = ();
@lead_bytes = ();
@uni2cp = ();
# ASCII chars
for ($i = 0x00; $i <= 0x7f; $i++)
......@@ -1145,8 +1148,13 @@ sub HANDLE_FILE
{
my ($codepage,$filename,$comment) = @_;
@cp2uni = ();
@lead_bytes = ();
@uni2cp = ();
# symbol codepage file is special
if ($codepage == 20932) { READ_JIS0208_FILE($MAPPREFIX . $filename); }
elsif ($codepage == 20127) { fill_20127_codepage(); }
else { READ_FILE($MAPPREFIX . $filename); }
# hack: 0x00a5 must map to backslash in Shift-JIS
......@@ -1157,12 +1165,12 @@ sub HANDLE_FILE
my $output = sprintf "c_%03d.c", $codepage;
open OUTPUT,">$output.new" or die "Cannot create $output";
printf "Building %s from %s (%s)\n", $output, $filename, $comment;
printf "Building %s from %s (%s)\n", $output, $filename || "hardcoded data", $comment;
# dump all tables
printf OUTPUT "/* code page %03d (%s) */\n", $codepage, $comment;
printf OUTPUT "/* generated from %s */\n", $MAPPREFIX . $filename;
printf OUTPUT "/* generated from %s */\n", $MAPPREFIX . $filename if $filename;
printf OUTPUT "/* DO NOT EDIT!! */\n\n";
printf OUTPUT "#include \"wine/unicode.h\"\n\n";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment