Skip to content

Commit 872cefe

Browse files
authored
Merge pull request Dual-Life#19 from khwilliamson/master
Generalize tests for EBCDIC
2 parents 914b3ef + 671f0b9 commit 872cefe

File tree

1 file changed

+71
-65
lines changed

1 file changed

+71
-65
lines changed

t/inc/Pod/PlainText.pm

Lines changed: 71 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ BEGIN {
3737
require Symbol;
3838
Symbol->import;
3939
}
40+
if ($] < 5.008 || ord "A" == 65) {
41+
*to_native = sub { return chr shift; };
42+
}
43+
else {
44+
*to_native = sub { return chr utf8::unicode_to_native(shift); };
45+
}
4046
}
4147

4248
############################################################################
@@ -52,71 +58,71 @@ BEGIN {
5258
'gt' => '>', # right chevron, greater-than
5359
'quot' => '"', # double quote
5460

55-
"Aacute" => "\xC1", # capital A, acute accent
56-
"aacute" => "\xE1", # small a, acute accent
57-
"Acirc" => "\xC2", # capital A, circumflex accent
58-
"acirc" => "\xE2", # small a, circumflex accent
59-
"AElig" => "\xC6", # capital AE diphthong (ligature)
60-
"aelig" => "\xE6", # small ae diphthong (ligature)
61-
"Agrave" => "\xC0", # capital A, grave accent
62-
"agrave" => "\xE0", # small a, grave accent
63-
"Aring" => "\xC5", # capital A, ring
64-
"aring" => "\xE5", # small a, ring
65-
"Atilde" => "\xC3", # capital A, tilde
66-
"atilde" => "\xE3", # small a, tilde
67-
"Auml" => "\xC4", # capital A, dieresis or umlaut mark
68-
"auml" => "\xE4", # small a, dieresis or umlaut mark
69-
"Ccedil" => "\xC7", # capital C, cedilla
70-
"ccedil" => "\xE7", # small c, cedilla
71-
"Eacute" => "\xC9", # capital E, acute accent
72-
"eacute" => "\xE9", # small e, acute accent
73-
"Ecirc" => "\xCA", # capital E, circumflex accent
74-
"ecirc" => "\xEA", # small e, circumflex accent
75-
"Egrave" => "\xC8", # capital E, grave accent
76-
"egrave" => "\xE8", # small e, grave accent
77-
"ETH" => "\xD0", # capital Eth, Icelandic
78-
"eth" => "\xF0", # small eth, Icelandic
79-
"Euml" => "\xCB", # capital E, dieresis or umlaut mark
80-
"euml" => "\xEB", # small e, dieresis or umlaut mark
81-
"Iacute" => "\xCD", # capital I, acute accent
82-
"iacute" => "\xED", # small i, acute accent
83-
"Icirc" => "\xCE", # capital I, circumflex accent
84-
"icirc" => "\xEE", # small i, circumflex accent
85-
"Igrave" => "\xCD", # capital I, grave accent
86-
"igrave" => "\xED", # small i, grave accent
87-
"Iuml" => "\xCF", # capital I, dieresis or umlaut mark
88-
"iuml" => "\xEF", # small i, dieresis or umlaut mark
89-
"Ntilde" => "\xD1", # capital N, tilde
90-
"ntilde" => "\xF1", # small n, tilde
91-
"Oacute" => "\xD3", # capital O, acute accent
92-
"oacute" => "\xF3", # small o, acute accent
93-
"Ocirc" => "\xD4", # capital O, circumflex accent
94-
"ocirc" => "\xF4", # small o, circumflex accent
95-
"Ograve" => "\xD2", # capital O, grave accent
96-
"ograve" => "\xF2", # small o, grave accent
97-
"Oslash" => "\xD8", # capital O, slash
98-
"oslash" => "\xF8", # small o, slash
99-
"Otilde" => "\xD5", # capital O, tilde
100-
"otilde" => "\xF5", # small o, tilde
101-
"Ouml" => "\xD6", # capital O, dieresis or umlaut mark
102-
"ouml" => "\xF6", # small o, dieresis or umlaut mark
103-
"szlig" => "\xDF", # small sharp s, German (sz ligature)
104-
"THORN" => "\xDE", # capital THORN, Icelandic
105-
"thorn" => "\xFE", # small thorn, Icelandic
106-
"Uacute" => "\xDA", # capital U, acute accent
107-
"uacute" => "\xFA", # small u, acute accent
108-
"Ucirc" => "\xDB", # capital U, circumflex accent
109-
"ucirc" => "\xFB", # small u, circumflex accent
110-
"Ugrave" => "\xD9", # capital U, grave accent
111-
"ugrave" => "\xF9", # small u, grave accent
112-
"Uuml" => "\xDC", # capital U, dieresis or umlaut mark
113-
"uuml" => "\xFC", # small u, dieresis or umlaut mark
114-
"Yacute" => "\xDD", # capital Y, acute accent
115-
"yacute" => "\xFD", # small y, acute accent
116-
"yuml" => "\xFF", # small y, dieresis or umlaut mark
117-
118-
"lchevron" => "\xAB", # left chevron (double less than)
119-
"rchevron" => "\xBB", # right chevron (double greater than)
61+
"Aacute" => to_native(0xC1), # capital A, acute accent
62+
"aacute" => to_native(0xE1), # small a, acute accent
63+
"Acirc" => to_native(0xC2), # capital A, circumflex accent
64+
"acirc" => to_native(0xE2), # small a, circumflex accent
65+
"AElig" => to_native(0xC6), # capital AE diphthong (ligature)
66+
"aelig" => to_native(0xE6), # small ae diphthong (ligature)
67+
"Agrave" => to_native(0xC0), # capital A, grave accent
68+
"agrave" => to_native(0xE0), # small a, grave accent
69+
"Aring" => to_native(0xC5), # capital A, ring
70+
"aring" => to_native(0xE5), # small a, ring
71+
"Atilde" => to_native(0xC3), # capital A, tilde
72+
"atilde" => to_native(0xE3), # small a, tilde
73+
"Auml" => to_native(0xC4), # capital A, dieresis or umlaut mark
74+
"auml" => to_native(0xE4), # small a, dieresis or umlaut mark
75+
"Ccedil" => to_native(0xC7), # capital C, cedilla
76+
"ccedil" => to_native(0xE7), # small c, cedilla
77+
"Eacute" => to_native(0xC9), # capital E, acute accent
78+
"eacute" => to_native(0xE9), # small e, acute accent
79+
"Ecirc" => to_native(0xCA), # capital E, circumflex accent
80+
"ecirc" => to_native(0xEA), # small e, circumflex accent
81+
"Egrave" => to_native(0xC8), # capital E, grave accent
82+
"egrave" => to_native(0xE8), # small e, grave accent
83+
"ETH" => to_native(0xD0), # capital Eth, Icelandic
84+
"eth" => to_native(0xF0), # small eth, Icelandic
85+
"Euml" => to_native(0xCB), # capital E, dieresis or umlaut mark
86+
"euml" => to_native(0xEB), # small e, dieresis or umlaut mark
87+
"Iacute" => to_native(0xCD), # capital I, acute accent
88+
"iacute" => to_native(0xED), # small i, acute accent
89+
"Icirc" => to_native(0xCE), # capital I, circumflex accent
90+
"icirc" => to_native(0xEE), # small i, circumflex accent
91+
"Igrave" => to_native(0xCD), # capital I, grave accent
92+
"igrave" => to_native(0xED), # small i, grave accent
93+
"Iuml" => to_native(0xCF), # capital I, dieresis or umlaut mark
94+
"iuml" => to_native(0xEF), # small i, dieresis or umlaut mark
95+
"Ntilde" => to_native(0xD1), # capital N, tilde
96+
"ntilde" => to_native(0xF1), # small n, tilde
97+
"Oacute" => to_native(0xD3), # capital O, acute accent
98+
"oacute" => to_native(0xF3), # small o, acute accent
99+
"Ocirc" => to_native(0xD4), # capital O, circumflex accent
100+
"ocirc" => to_native(0xF4), # small o, circumflex accent
101+
"Ograve" => to_native(0xD2), # capital O, grave accent
102+
"ograve" => to_native(0xF2), # small o, grave accent
103+
"Oslash" => to_native(0xD8), # capital O, slash
104+
"oslash" => to_native(0xF8), # small o, slash
105+
"Otilde" => to_native(0xD5), # capital O, tilde
106+
"otilde" => to_native(0xF5), # small o, tilde
107+
"Ouml" => to_native(0xD6), # capital O, dieresis or umlaut mark
108+
"ouml" => to_native(0xF6), # small o, dieresis or umlaut mark
109+
"szlig" => to_native(0xDF), # small sharp s, German (sz ligature)
110+
"THORN" => to_native(0xDE), # capital THORN, Icelandic
111+
"thorn" => to_native(0xFE), # small thorn, Icelandic
112+
"Uacute" => to_native(0xDA), # capital U, acute accent
113+
"uacute" => to_native(0xFA), # small u, acute accent
114+
"Ucirc" => to_native(0xDB), # capital U, circumflex accent
115+
"ucirc" => to_native(0xFB), # small u, circumflex accent
116+
"Ugrave" => to_native(0xD9), # capital U, grave accent
117+
"ugrave" => to_native(0xF9), # small u, grave accent
118+
"Uuml" => to_native(0xDC), # capital U, dieresis or umlaut mark
119+
"uuml" => to_native(0xFC), # small u, dieresis or umlaut mark
120+
"Yacute" => to_native(0xDD), # capital Y, acute accent
121+
"yacute" => to_native(0xFD), # small y, acute accent
122+
"yuml" => to_native(0xFF), # small y, dieresis or umlaut mark
123+
124+
"lchevron" => to_native(0xAB), # left chevron (double less than)
125+
"rchevron" => to_native(0xBB), # right chevron (double greater than)
120126
);
121127

122128

0 commit comments

Comments
 (0)