aboutsummaryrefslogtreecommitdiffstats
path: root/epan/charsets.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2019-05-24 17:39:54 -0700
committerGuy Harris <guy@alum.mit.edu>2019-05-25 01:07:36 +0000
commit03c5da8d8930c0456888a4d13ed2648513565d5c (patch)
treedf40e79374047bd27689152c619ced55d977610a /epan/charsets.c
parent1fd3003a6d445047e99d13f6804b5b84425a7a46 (diff)
Add Windows code page 1252.
While we're at it, add the Euro to code page 1251, expand the comments for 1250 and 1251 and some DOS code pages, and add support for code page 1251 to tvb_get_stringz_enc(). Change-Id: I053d58f87cac26ad7c109e2f1cd8807ffec0622d Reviewed-on: https://code.wireshark.org/review/33342 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/charsets.c')
-rw-r--r--epan/charsets.c66
1 files changed, 61 insertions, 5 deletions
diff --git a/epan/charsets.c b/epan/charsets.c
index 1973039c6f..f953a4727e 100644
--- a/epan/charsets.c
+++ b/epan/charsets.c
@@ -399,7 +399,13 @@ const gunichar2 charset_table_iso_8859_16[0x80] = {
0x0171, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x0119, 0x021b, 0x00ff, /* - 0xFF */
};
-/* Windows-1250 (http://en.wikipedia.org/wiki/Windows-1250) */
+/*
+ * Windows-1250
+ *
+ * See:
+ * https://en.wikipedia.org/wiki/Windows-1250)
+ * https://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1250.TXT
+ */
const gunichar2 charset_table_cp1250[0x80] = {
0x20ac, UNREPL, 0x201a, UNREPL, 0x201e, 0x2026, 0x2020, 0x2021, /* 0x80 - */
UNREPL, 0x2030, 0x0160, 0x2039, 0x015a, 0x0164, 0x017d, 0x0179, /* - 0x8F */
@@ -419,10 +425,16 @@ const gunichar2 charset_table_cp1250[0x80] = {
0x0159, 0x016f, 0x00fa, 0x0171, 0x00fc, 0x00fd, 0x0163, 0x02d9, /* - 0xFF */
};
-/* Windows-1251 (http://en.wikipedia.org/wiki/Windows-1251) */
+/*
+ * Windows-1251
+ *
+ * See:
+ * https://en.wikipedia.org/wiki/Windows-1251
+ * https://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1251.TXT
+ */
const gunichar2 charset_table_cp1251[0x80] = {
0x0402, 0x0403, 0x201a, 0x0453, 0x201e, 0x2026, 0x2020, 0x2021, /* 0x80 - */
- UNREPL, 0x2030, 0x0409, 0x2039, 0x040a, 0x040c, 0x040B, 0x040f, /* - 0x8F */
+ 0x20ac, 0x2030, 0x0409, 0x2039, 0x040a, 0x040c, 0x040B, 0x040f, /* - 0x8F */
0x0452, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, /* 0x90 - */
UNREPL, 0x2122, 0x0459, 0x203a, 0x045a, 0x045c, 0x045b, 0x045f, /* - 0x9F */
0x00a0, 0x040e, 0x045e, 0x0408, 0x00a4, 0x0490, 0x00a6, 0x00a7, /* 0xA0 - */
@@ -439,6 +451,32 @@ const gunichar2 charset_table_cp1251[0x80] = {
0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f, /* - 0xFF */
};
+/*
+ * Windows-1252
+ *
+ * See:
+ * https://en.wikipedia.org/wiki/Windows-1252
+ * https://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1252.TXT
+ */
+const gunichar2 charset_table_cp1252[0x80] = {
+ 0x20ac, UNREPL, 0x201a, 0x0192, 0x201e, 0x2026, 0x2020, 0x2021, /* 0x80 - */
+ 0x02c6, 0x2030, 0x0160, 0x2039, 0x0152, UNREPL, 0x0172, UNREPL, /* - 0x8F */
+ UNREPL, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, /* 0x90 - */
+ 0x02dc, 0x2122, 0x0161, 0x203a, 0x0153, UNREPL, 0x0173, 0x0178, /* - 0x9F */
+ 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, /* 0xA0 - */
+ 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, /* - 0xAF */
+ 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, /* 0xB0 - */
+ 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, /* - 0xBF */
+ 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, /* 0xC0 - */
+ 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, /* - 0xCF */
+ 0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, /* 0xD0 - */
+ 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df, /* - 0xDF */
+ 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, /* 0xE0 - */
+ 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, /* - 0xEF */
+ 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, /* 0xF0 - */
+ 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff, /* - 0xFF */
+};
+
/* generated by ./make_charset_table MACROMAN */
/* That's "MacRoman", not "Macro Man" (faster than a speeding recursive expansion!) */
const gunichar2 charset_table_mac_roman[0x80] = {
@@ -480,7 +518,19 @@ const gunichar2 charset_table_cp437[0x80] = {
0x00b0, 0x2219, 0x00b7, 0x221a, 0x207f, 0x00b2, 0x25a0, 0x00a0, /* - 0xFF */
};
-/* CP855 (http://en.wikipedia.org/wiki/CP855) */
+/*
+ * CP855
+ *
+ * See
+ * https://en.wikipedia.org/wiki/CP855
+ * https://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/PC/CP855.TXT
+ *
+ * XXX - this doesn't have the graphics for 0x00 through 0x1F shown
+ * on the Wikipedia page, but not in the Microsoft mapping file;
+ * that would require a 256-code-point mapping table. (Are those
+ * positions used for the same graphics on all code pages - the PC
+ * graphics set, or whatever it's called?)
+ */
const gunichar2 charset_table_cp855[0x80] = {
0x0452, 0x0402, 0x0453, 0x0403, 0x0451, 0x0401, 0x0454, 0x0404, /* 0x80 - */
0x0455, 0x0405, 0x0456, 0x0406, 0x0457, 0x0407, 0x0458, 0x0408, /* - 0x8F */
@@ -500,7 +550,13 @@ const gunichar2 charset_table_cp855[0x80] = {
0x042d, 0x0449, 0x0429, 0x0447, 0x0427, 0x00a7, 0x25a0, 0x00a0, /* - 0xFF */
};
-/* CP855 (http://en.wikipedia.org/wiki/CP866) */
+/*
+ * CP866
+ *
+ * See:
+ * https://en.wikipedia.org/wiki/CP866
+ * https://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/PC/CP866.TXT
+ */
const gunichar2 charset_table_cp866[0x80] = {
0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, /* 0x80 - */
0x0418, 0x0419, 0x041A, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f, /* - 0x8F */