=encoding utf8 =head1 NAME perlebcdic - Considerations for running Perl on EBCDIC platforms =head1 DESCRIPTION An exploration of some of the issues facing Perl programmers on EBCDIC based computers. Portions of this document that are still incomplete are marked with XXX. Early Perl versions worked on some EBCDIC machines, but after v5.8.7, until v5.22, it likely didn't. Theoretically, it could work on OS/400 or Siemens' BS2000 (or their successors), but this is untested. In v5.22 and 5.24, not all the modules found on CPAN but shipped with core Perl work on z/OS. If you want to use Perl on a non-z/OS EBCDIC machine, please let us know at L. Writing Perl on an EBCDIC platform is really no different than writing on an L one, but with different underlying numbers, as we'll see shortly. You'll have to know something about those L platforms because the documentation is biased and will frequently use example numbers that don't apply to EBCDIC. There are also very few CPAN modules that are written for EBCDIC and which don't work on ASCII; instead the vast majority of CPAN modules are written for ASCII, and some may happen to work on EBCDIC, while a few have been designed to portably work on both. If your code just uses the 52 letters A-Z and a-z, plus SPACE, the digits 0-9, and the punctuation characters that Perl uses, plus a few controls that are denoted by escape sequences like C and C, then there's nothing special about using Perl, and your code may very well work on an EBCDIC machine without change. But if you write code that uses C to mean a TAB or C to mean an "A", or C to mean a "E" (small C with a diaeresis), then your code may well work on your EBCDIC platform, but not on an ASCII one. That's fine to do if no one will ever want to run your code on an ASCII platform; but the bias in this document will be towards writing code portable between EBCDIC and ASCII systems. Again, if every character you care about is easily enterable from your keyboard, you don't have to know anything about ASCII, but many keyboards don't easily allow you to directly enter, say, the character C, so you have to specify it indirectly, such as by using the C escape sequence. In those cases it's easiest to know something about the ASCII/Unicode character sets. If you know that the small "E" is C, then you can instead specify it as C, and have the computer automatically translate it to C on your platform, and leave it as C on ASCII ones. Or you could specify it by name, C and not have to know the numbers. Either way works, but both require familiarity with Unicode. =head1 COMMON CHARACTER CODE SETS =head2 ASCII The American Standard Code for Information Interchange (ASCII or US-ASCII) is a set of integers running from 0 to 127 (decimal) that have standardized interpretations by the computers which use ASCII. For example, 65 means the letter "A". The range 0..127 can be covered by setting various bits in a 7-bit binary digit, hence the set is sometimes referred to as "7-bit ASCII". ASCII was described by the American National Standards Institute document ANSI X3.4-1986. It was also described by ISO 646:1991 (with localization for currency symbols). The full ASCII set is given in the table L as the first 128 elements. Languages that can be written adequately with the characters in ASCII include English, Hawaiian, Indonesian, Swahili and some Native American languages. Most non-EBCDIC character sets are supersets of ASCII. That is the integers 0-127 mean what ASCII says they mean. But integers 128 and above are specific to the character set. Many of these fit entirely into 8 bits, using ASCII as 0-127, while specifying what 128-255 mean, and not using anything above 255. Thus, these are single-byte (or octet if you prefer) character sets. One important one (since Unicode is a superset of it) is the ISO 8859-1 character set. =head2 ISO 8859 The ISO 8859-I> are a collection of character code sets from the International Organization for Standardization (ISO), each of which adds characters to the ASCII set that are typically found in various languages, many of which are based on the Roman, or Latin, alphabet. Most are for European languages, but there are also ones for Arabic, Greek, Hebrew, and Thai. There are good references on the web about all these. =head3 Latin 1 (ISO 8859-1) A particular 8-bit extension to ASCII that includes grave and acute accented Latin characters. Languages that can employ ISO 8859-1 include all the languages covered by ASCII as well as Afrikaans, Albanian, Basque, Catalan, Danish, Faroese, Finnish, Norwegian, Portuguese, Spanish, and Swedish. Dutch is covered albeit without the ij ligature. French is covered too but without the oe ligature. German can use ISO 8859-1 but must do so without German-style quotation marks. This set is based on Western European extensions to ASCII and is commonly encountered in World Wide Web work. In IBM character code set identification terminology, ISO 8859-1 is also known as CCSID 819 (or sometimes 0819 or even 00819). Unicode uses ASCII plus Latin 1 as its base, adding many many more characters. =head3 Other ISO 8859-1 encodings Every one of these encodings include every character in ASCII (encoded identically); the differences are in the additional characters added, which are tailored for the language(s) the encoding is designed to support. To access these, the locale system of Perl must be used. See L. =head2 EBCDIC The Extended Binary Coded Decimal Interchange Code refers to a large collection of single- and multi-byte coded character sets that are quite different from ASCII and ISO 8859-1, and are all slightly different from each other; they typically run on host computers. The EBCDIC encodings derive from 8-bit byte extensions of Hollerith punched card encodings, which long predate ASCII. The layout on the cards was such that high bits were set for the upper and lower case alphabetic characters C and C, but there were gaps within each Latin alphabet range, visible in the table L. These gaps can cause complications. Some IBM EBCDIC character sets may be known by character code set identification numbers (CCSID numbers) or code page numbers. Perl can be compiled on platforms that run any of three commonly used EBCDIC character sets, listed below. (And it should be easy to add additional ones, except for the inevitable glitches that could crop up.) =head3 The 13 variant characters Among IBM EBCDIC character code sets there are 13 characters that are often mapped to different integer values. Those characters are known as the 13 "variant" characters and are: \ [ ] { } ^ ~ ! # | $ @ ` When Perl is compiled for a platform, it looks at all of these characters to guess which EBCDIC character set the platform uses, and adapts itself accordingly to that platform. If the platform uses a character set that is not one of the three Perl knows about, Perl will either fail to compile, or mistakenly and silently choose one of the three. The Line Feed (LF) character is actually a 14th variant character, and Perl checks for that as well. These variant characters are the main reason that EBCDIC can't be handled by Perl's L. All the characters are used all over the place in Perl programs. When you type one of them in at your keyboard, its meaning must be what you expect it to be; which could easily be violated if another code page is in use. Therefore the Perl interpreter must be compiled for a particular code page. (The implementation is mostly table driven. If a new code page needed to be added, simply add a new table to F that translates from ASCII to the new page, and then regenerate. And then go deal with any glitches. =head3 EBCDIC code sets recognized by Perl =over =item B Character code set ID 0037 is a mapping of the ASCII plus Latin-1 characters (i.e. ISO 8859-1) to an EBCDIC set. 0037 is used in North American English locales on the OS/400 operating system that runs on AS/400 computers. CCSID 0037 differs from ISO 8859-1 in 236 places; in other words they agree on only 20 code point values. All but one of those is a control character. The only printable character that has the same ordinal number in this code page (and the others below) as ASCII is the PILCROW SIGN, C>. =item B Character code set ID 1047 is also a mapping of the ASCII plus Latin-1 characters (i.e. ISO 8859-1) to an EBCDIC set. 1047 is used under Unix System Services for OS/390 or z/OS, and OpenEdition for VM/ESA. CCSID 1047 differs from CCSID 0037 in eight places, and from ISO 8859-1 in 236. =item B This code page is no longer generated (although it would be easy to re-enable it). The Siemens' BS2000 systems which used it have been discontinued. It is distinct from 1047 and 0037, and is identified below as the POSIX-BC set. Like 0037 and 1047, it is the same as ISO 8859-1 in 20 code point values. =back =head2 Unicode code points versus EBCDIC code points In Unicode terminology a I is the number assigned to a character: for example, in EBCDIC the character "A" is usually assigned the number 193. In Unicode, the character "A" is assigned the number 65. All the code points in ASCII and Latin-1 (ISO 8859-1) have the same meaning in Unicode. All three of the recognized EBCDIC code sets have 256 code points, and in each code set, all 256 code points are mapped to equivalent Latin1 code points. Obviously, "A" will map to "A", "B" => "B", "%" => "%", etc., for all printable characters in Latin1 and these code pages. It also turns out that EBCDIC has nearly precise equivalents for the ASCII/Latin1 C0 controls and the DELETE control. (The C0 controls are those whose ASCII code points are 0..0x1F; things like TAB, ACK, BEL, etc.) A mapping is set up between these ASCII/EBCDIC controls. There isn't such a precise mapping between the C1 controls on ASCII platforms and the remaining EBCDIC controls. What has been done is to map these controls, mostly arbitrarily, to some otherwise unmatched character in the other character set. Most of these are very very rarely used nowadays in EBCDIC anyway, and their names have been dropped, without much complaint. For example the EO (Eight Ones) EBCDIC control (consisting of eight one bits = 0xFF) is mapped to the C1 APC control (0x9F), and you can't use the name "EO". The EBCDIC controls provide three possible line terminator characters, CR (0x0D), LF (0x25), and NL (0x15). On ASCII platforms, the symbols "NL" and "LF" refer to the same character, but in strict EBCDIC terminology they are different ones. The EBCDIC NL is mapped to the C1 control called "NEL" ("Next Line"; here's a case where the mapping makes quite a bit of sense, and hence isn't just arbitrary). On some EBCDIC platforms, this NL or NEL is the typical line terminator. This is true of z/OS and BS2000. In these platforms, the C compilers will swap the LF and NEL code points, so that C is 0x15, and refers to NL. Perl does that too; you can see it in the code chart L. This makes things generally "just work" without you even having to be aware that there is a swap. =head2 Unicode and UTF UTF stands for "Unicode Transformation Format". UTF-8 is an encoding of Unicode into a sequence of 8-bit byte chunks, based on ASCII and Latin-1. The length of a sequence required to represent a Unicode code point depends on the ordinal number of that code point, with larger numbers requiring more bytes. UTF-EBCDIC is like UTF-8, but based on EBCDIC. They are enough alike that often, casual usage will conflate the two terms, and use "UTF-8" to mean both the UTF-8 found on ASCII platforms, and the UTF-EBCDIC found on EBCDIC ones. You may see the term "invariant" character or code point. This simply means that the character has the same numeric value and representation when encoded in UTF-8 (or UTF-EBCDIC) as when not. (Note that this is a very different concept from L mentioned above. Careful prose will use the term "UTF-8 invariant" instead of just "invariant", but most often you'll see just "invariant".) For example, the ordinal value of "A" is 193 in most EBCDIC code pages, and also is 193 when encoded in UTF-EBCDIC. All UTF-8 (or UTF-EBCDIC) variant code points occupy at least two bytes when encoded in UTF-8 (or UTF-EBCDIC); by definition, the UTF-8 (or UTF-EBCDIC) invariant code points are exactly one byte whether encoded in UTF-8 (or UTF-EBCDIC), or not. (By now you see why people typically just say "UTF-8" when they also mean "UTF-EBCDIC". For the rest of this document, we'll mostly be casual about it too.) In ASCII UTF-8, the code points corresponding to the lowest 128 ordinal numbers (0 - 127: the ASCII characters) are invariant. In UTF-EBCDIC, there are 160 invariant characters. (If you care, the EBCDIC invariants are those characters which have ASCII equivalents, plus those that correspond to the C1 controls (128 - 159 on ASCII platforms).) A string encoded in UTF-EBCDIC may be longer (very rarely shorter) than one encoded in UTF-8. Perl extends both UTF-8 and UTF-EBCDIC so that they can encode code points above the Unicode maximum of U+10FFFF. Both extensions are constructed to allow encoding of any code point that fits in a 64-bit word. UTF-EBCDIC is defined by L (often referred to as just TR16). It is defined based on CCSID 1047, not allowing for the differences for other code pages. This allows for easy interchange of text between computers running different code pages, but makes it unusable, without adaptation, for Perl on those other code pages. The reason for this unusability is that a fundamental assumption of Perl is that the characters it cares about for parsing and lexical analysis are the same whether or not the text is in UTF-8. For example, Perl expects the character C to have the same representation, no matter if the string containing it (or program text) is UTF-8 encoded or not. To ensure this, Perl adapts UTF-EBCDIC to the particular code page so that all characters it expects to be UTF-8 invariant are in fact UTF-8 invariant. This means that text generated on a computer running one version of Perl's UTF-EBCDIC has to be translated to be intelligible to a computer running another. TR16 implies a method to extend UTF-EBCDIC to encode points up through S>. Perl uses this method for code points up through S>, but uses an incompatible method for larger ones, to enable it to handle much larger code points than otherwise. =head2 Using Encode Starting from Perl 5.8 you can use the standard module Encode to translate from EBCDIC to Latin-1 code points. Encode knows about more EBCDIC character sets than Perl can currently be compiled to run on. use Encode 'from_to'; my %ebcdic = ( 176 => 'cp37', 95 => 'cp1047', 106 => 'posix-bc' ); # $x is in EBCDIC code points from_to($x, $ebcdic{ord '^'}, 'latin1'); # $x is ISO 8859-1 code points and from Latin-1 code points to EBCDIC code points use Encode 'from_to'; my %ebcdic = ( 176 => 'cp37', 95 => 'cp1047', 106 => 'posix-bc' ); # $x is ISO 8859-1 code points from_to($x, 'latin1', $ebcdic{ord '^'}); # $x is in EBCDIC code points For doing I/O it is suggested that you use the autotranslating features of PerlIO, see L. Since version 5.8 Perl uses the PerlIO I/O library. This enables you to use different encodings per IO channel. For example you may use use Encode; open($f, ">:encoding(ascii)", "test.ascii"); print $f "Hello World!\n"; open($f, ">:encoding(cp37)", "test.ebcdic"); print $f "Hello World!\n"; open($f, ">:encoding(latin1)", "test.latin1"); print $f "Hello World!\n"; open($f, ">:encoding(utf8)", "test.utf8"); print $f "Hello World!\n"; to get four files containing "Hello World!\n" in ASCII, CP 0037 EBCDIC, ISO 8859-1 (Latin-1) (in this example identical to ASCII since only ASCII characters were printed), and UTF-EBCDIC (in this example identical to normal EBCDIC since only characters that don't differ between EBCDIC and UTF-EBCDIC were printed). See the documentation of L<:perlio> for details. As the PerlIO layer uses raw IO (bytes) internally, all this totally ignores things like the type of your filesystem (ASCII or EBCDIC). =head1 SINGLE OCTET TABLES The following tables list the ASCII and Latin 1 ordered sets including the subsets: C0 controls (0..31), ASCII graphics (32..7e), delete (7f), C1 controls (80..9f), and Latin-1 (a.k.a. ISO 8859-1) (a0..ff). In the table names of the Latin 1 extensions to ASCII have been labelled with character names roughly corresponding to I albeit with substitutions such as C and C in all cases; S> in some cases; and S> in some other cases. Controls are listed using their Unicode 6.2 abbreviations. The differences between the 0037 and 1047 sets are flagged with C. The differences between the 1047 and POSIX-BC sets are flagged with C All C numbers listed are decimal. If you would rather see this table listing octal values, then run the table (that is, the pod source text of this document, since this recipe may not work with a pod2_other_format translation) through: =over 4 =item recipe 0 =back perl -ne 'if(/(.{29})(\d+)\s+(\d+)\s+(\d+)\s+(\d+)/)' \ -e '{printf("%s%-5.03o%-5.03o%-5.03o%.03o\n",$1,$2,$3,$4,$5)}' \ perlebcdic.pod If you want to retain the UTF-x code points then in script form you might want to write: =over 4 =item recipe 1 =back open(FH,") { if (/(.{29})(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\.?(\d*) \s+(\d+)\.?(\d*)/x) { if ($7 ne '' && $9 ne '') { printf( "%s%-5.03o%-5.03o%-5.03o%-5.03o%-3o.%-5o%-3o.%.03o\n", $1,$2,$3,$4,$5,$6,$7,$8,$9); } elsif ($7 ne '') { printf("%s%-5.03o%-5.03o%-5.03o%-5.03o%-3o.%-5o%.03o\n", $1,$2,$3,$4,$5,$6,$7,$8); } else { printf("%s%-5.03o%-5.03o%-5.03o%-5.03o%-5.03o%.03o\n", $1,$2,$3,$4,$5,$6,$8); } } } If you would rather see this table listing hexadecimal values then run the table through: =over 4 =item recipe 2 =back perl -ne 'if(/(.{29})(\d+)\s+(\d+)\s+(\d+)\s+(\d+)/)' \ -e '{printf("%s%-5.02X%-5.02X%-5.02X%.02X\n",$1,$2,$3,$4,$5)}' \ perlebcdic.pod Or, in order to retain the UTF-x code points in hexadecimal: =over 4 =item recipe 3 =back open(FH,") { if (/(.{29})(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\.?(\d*) \s+(\d+)\.?(\d*)/x) { if ($7 ne '' && $9 ne '') { printf( "%s%-5.02X%-5.02X%-5.02X%-5.02X%-2X.%-6.02X%02X.%02X\n", $1,$2,$3,$4,$5,$6,$7,$8,$9); } elsif ($7 ne '') { printf("%s%-5.02X%-5.02X%-5.02X%-5.02X%-2X.%-6.02X%02X\n", $1,$2,$3,$4,$5,$6,$7,$8); } else { printf("%s%-5.02X%-5.02X%-5.02X%-5.02X%-5.02X%02X\n", $1,$2,$3,$4,$5,$6,$8); } } } ISO 8859-1 POS- CCSID CCSID CCSID CCSID IX- 1047 chr 0819 0037 1047 BC UTF-8 UTF-EBCDIC --------------------------------------------------------------------- 0 0 0 0 0 0 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3 3 4 55 55 55 4 55 5 45 45 45 5 45 6 46 46 46 6 46 7 47 47 47 7 47 8 22 22 22 8 22 9 5 5 5 9 5 10 37 21 21 10 21 ** 11 11 11 11 11 11 12 12 12 12 12 12 13 13 13 13 13 13 14 14 14 14 14 14 15 15 15 15 15 15 16 16 16 16 16 16 17 17 17 17 17 17 18 18 18 18 18 18 19 19 19 19 19 19 20 60 60 60 20 60 21 61 61 61 21 61 22 50 50 50 22 50 23 38 38 38 23 38 24 24 24 24 24 24 25 25 25 25 25 25 26 63 63 63 26 63 27 39 39 39 27 39 28 28 28 28 28 28 29 29 29 29 29 29 30 30 30 30 30 30 31 31 31 31 31 31 32 64 64 64 32 64 ! 33 90 90 90 33 90 " 34 127 127 127 34 127 # 35 123 123 123 35 123 $ 36 91 91 91 36 91 % 37 108 108 108 37 108 & 38 80 80 80 38 80 ' 39 125 125 125 39 125 ( 40 77 77 77 40 77 ) 41 93 93 93 41 93 * 42 92 92 92 42 92 + 43 78 78 78 43 78 , 44 107 107 107 44 107 - 45 96 96 96 45 96 . 46 75 75 75 46 75 / 47 97 97 97 47 97 0 48 240 240 240 48 240 1 49 241 241 241 49 241 2 50 242 242 242 50 242 3 51 243 243 243 51 243 4 52 244 244 244 52 244 5 53 245 245 245 53 245 6 54 246 246 246 54 246 7 55 247 247 247 55 247 8 56 248 248 248 56 248 9 57 249 249 249 57 249 : 58 122 122 122 58 122 ; 59 94 94 94 59 94 62 110 110 110 62 110 ? 63 111 111 111 63 111 @ 64 124 124 124 64 124 A 65 193 193 193 65 193 B 66 194 194 194 66 194 C 67 195 195 195 67 195 D 68 196 196 196 68 196 E 69 197 197 197 69 197 F 70 198 198 198 70 198 G 71 199 199 199 71 199 H 72 200 200 200 72 200 I 73 201 201 201 73 201 J 74 209 209 209 74 209 K 75 210 210 210 75 210 L 76 211 211 211 76 211 M 77 212 212 212 77 212 N 78 213 213 213 78 213 O 79 214 214 214 79 214 P 80 215 215 215 80 215 Q 81 216 216 216 81 216 R 82 217 217 217 82 217 S 83 226 226 226 83 226 T 84 227 227 227 84 227 U 85 228 228 228 85 228 V 86 229 229 229 86 229 W 87 230 230 230 87 230 X 88 231 231 231 88 231 Y 89 232 232 232 89 232 Z 90 233 233 233 90 233 [ 91 186 173 187 91 173 ** ## \ 92 224 224 188 92 224 ## ] 93 187 189 189 93 189 ** ^ 94 176 95 106 94 95 ** ## _ 95 109 109 109 95 109 ` 96 121 121 74 96 121 ## a 97 129 129 129 97 129 b 98 130 130 130 98 130 c 99 131 131 131 99 131 d 100 132 132 132 100 132 e 101 133 133 133 101 133 f 102 134 134 134 102 134 g 103 135 135 135 103 135 h 104 136 136 136 104 136 i 105 137 137 137 105 137 j 106 145 145 145 106 145 k 107 146 146 146 107 146 l 108 147 147 147 108 147 m 109 148 148 148 109 148 n 110 149 149 149 110 149 o 111 150 150 150 111 150 p 112 151 151 151 112 151 q 113 152 152 152 113 152 r 114 153 153 153 114 153 s 115 162 162 162 115 162 t 116 163 163 163 116 163 u 117 164 164 164 117 164 v 118 165 165 165 118 165 w 119 166 166 166 119 166 x 120 167 167 167 120 167 y 121 168 168 168 121 168 z 122 169 169 169 122 169 { 123 192 192 251 123 192 ## | 124 79 79 79 124 79 } 125 208 208 253 125 208 ## ~ 126 161 161 255 126 161 ## 127 7 7 7 127 7 128 32 32 32 194.128 32 129 33 33 33 194.129 33 130 34 34 34 194.130 34 131 35 35 35 194.131 35 132 36 36 36 194.132 36 133 21 37 37 194.133 37 ** 134 6 6 6 194.134 6 135 23 23 23 194.135 23 136 40 40 40 194.136 40 137 41 41 41 194.137 41 138 42 42 42 194.138 42 139 43 43 43 194.139 43 140 44 44 44 194.140 44 141 9 9 9 194.141 9 142 10 10 10 194.142 10 143 27 27 27 194.143 27 144 48 48 48 194.144 48 145 49 49 49 194.145 49 146 26 26 26 194.146 26 147 51 51 51 194.147 51 148 52 52 52 194.148 52 149 53 53 53 194.149 53 150 54 54 54 194.150 54 151 8 8 8 194.151 8 152 56 56 56 194.152 56 153 57 57 57 194.153 57 154 58 58 58 194.154 58 155 59 59 59 194.155 59 156 4 4 4 194.156 4 157 20 20 20 194.157 20 158 62 62 62 194.158 62 159 255 255 95 194.159 255 ## 160 65 65 65 194.160 128.65 161 170 170 170 194.161 128.66 162 74 74 176 194.162 128.67 ## 163 177 177 177 194.163 128.68 164 159 159 159 194.164 128.69 165 178 178 178 194.165 128.70 166 106 106 208 194.166 128.71 ##

167 181 181 181 194.167 128.72 168 189 187 121 194.168 128.73 ** ## 169 180 180 180 194.169 128.74 170 154 154 154 194.170 128.81 171 138 138 138 194.171 128.82 172 95 176 186 194.172 128.83 ** ## 173 202 202 202 194.173 128.84 174 175 175 175 194.174 128.85 175 188 188 161 194.175 128.86 ## 176 144 144 144 194.176 128.87 177 143 143 143 194.177 128.88 178 234 234 234 194.178 128.89 179 250 250 250 194.179 128.98 180 190 190 190 194.180 128.99 181 160 160 160 194.181 128.100 182 182 182 182 194.182 128.101 183 179 179 179 194.183 128.102 184 157 157 157 194.184 128.103 185 218 218 218 194.185 128.104 186 155 155 155 194.186 128.105 187 139 139 139 194.187 128.106 188 183 183 183 194.188 128.112 189 184 184 184 194.189 128.113 190 185 185 185 194.190 128.114 191 171 171 171 194.191 128.115 192 100 100 100 195.128 138.65 193 101 101 101 195.129 138.66 194 98 98 98 195.130 138.67 195 102 102 102 195.131 138.68 196 99 99 99 195.132 138.69 197 103 103 103 195.133 138.70 198 158 158 158 195.134 138.71 199 104 104 104 195.135 138.72 200 116 116 116 195.136 138.73 201 113 113 113 195.137 138.74 202 114 114 114 195.138 138.81 203 115 115 115 195.139 138.82 204 120 120 120 195.140 138.83 205 117 117 117 195.141 138.84 206 118 118 118 195.142 138.85 207 119 119 119 195.143 138.86 208 172 172 172 195.144 138.87 209 105 105 105 195.145 138.88 210 237 237 237 195.146 138.89 211 238 238 238 195.147 138.98 212 235 235 235 195.148 138.99 213 239 239 239 195.149 138.100 214 236 236 236 195.150 138.101 215 191 191 191 195.151 138.102 216 128 128 128 195.152 138.103 217 253 253 224 195.153 138.104 ## 218 254 254 254 195.154 138.105 219 251 251 221 195.155 138.106 ## 220 252 252 252 195.156 138.112 221 173 186 173 195.157 138.113 ** ## 222 174 174 174 195.158 138.114 223 89 89 89 195.159 138.115 224 68 68 68 195.160 139.65 225 69 69 69 195.161 139.66 226 66 66 66 195.162 139.67 227 70 70 70 195.163 139.68 228 67 67 67 195.164 139.69 229 71 71 71 195.165 139.70 230 156 156 156 195.166 139.71 231 72 72 72 195.167 139.72 232 84 84 84 195.168 139.73 233 81 81 81 195.169 139.74 234 82 82 82 195.170 139.81 235 83 83 83 195.171 139.82 236 88 88 88 195.172 139.83 237 85 85 85 195.173 139.84 238 86 86 86 195.174 139.85 239 87 87 87 195.175 139.86 240 140 140 140 195.176 139.87 241 73 73 73 195.177 139.88 242 205 205 205 195.178 139.89 243 206 206 206 195.179 139.98 244 203 203 203 195.180 139.99 245 207 207 207 195.181 139.100 246 204 204 204 195.182 139.101 247 225 225 225 195.183 139.102 248 112 112 112 195.184 139.103 249 221 221 192 195.185 139.104 ## 250 222 222 222 195.186 139.105 251 219 219 219 195.187 139.106 252 220 220 220 195.188 139.112 253 141 141 141 195.189 139.113 254 142 142 142 195.190 139.114 255 223 223 223 195.191 139.115 If you would rather see the above table in CCSID 0037 order rather than ASCII + Latin-1 order then run the table through: =over 4 =item recipe 4 =back perl \ -ne 'if(/.{29}\d{1,3}\s{2,4}\d{1,3}\s{2,4}\d{1,3}\s{2,4}\d{1,3}/)'\ -e '{push(@l,$_)}' \ -e 'END{print map{$_->[0]}' \ -e ' sort{$a->[1] $b->[1]}' \ -e ' map{[$_,substr($_,34,3)]}@l;}' perlebcdic.pod If you would rather see it in CCSID 1047 order then change the number 34 in the last line to 39, like this: =over 4 =item recipe 5 =back perl \ -ne 'if(/.{29}\d{1,3}\s{2,4}\d{1,3}\s{2,4}\d{1,3}\s{2,4}\d{1,3}/)'\ -e '{push(@l,$_)}' \ -e 'END{print map{$_->[0]}' \ -e ' sort{$a->[1] $b->[1]}' \ -e ' map{[$_,substr($_,39,3)]}@l;}' perlebcdic.pod If you would rather see it in POSIX-BC order then change the number 34 in the last line to 44, like this: =over 4 =item recipe 6 =back perl \ -ne 'if(/.{29}\d{1,3}\s{2,4}\d{1,3}\s{2,4}\d{1,3}\s{2,4}\d{1,3}/)'\ -e '{push(@l,$_)}' \ -e 'END{print map{$_->[0]}' \ -e ' sort{$a->[1] $b->[1]}' \ -e ' map{[$_,substr($_,44,3)]}@l;}' perlebcdic.pod =head2 Table in hex, sorted in 1047 order Since this document was first written, the convention has become more and more to use hexadecimal notation for code points. To do this with the recipes and to also sort is a multi-step process, so here, for convenience, is the table from above, re-sorted to be in Code Page 1047 order, and using hex notation. ISO 8859-1 POS- CCSID CCSID CCSID CCSID IX- 1047 chr 0819 0037 1047 BC UTF-8 UTF-EBCDIC --------------------------------------------------------------------- 00 00 00 00 00 00 01 01 01 01 01 01 02 02 02 02 02 02 03 03 03 03 03 03 9C 04 04 04 C2.9C 04 09 05 05 05 09 05 86 06 06 06 C2.86 06 7F 07 07 07 7F 07 97 08 08 08 C2.97 08 8D 09 09 09 C2.8D 09 8E 0A 0A 0A C2.8E 0A 0B 0B 0B 0B 0B 0B 0C 0C 0C 0C 0C 0C 0D 0D 0D 0D 0D 0D 0E 0E 0E 0E 0E 0E 0F 0F 0F 0F 0F 0F 10 10 10 10 10 10 11 11 11 11 11 11 12 12 12 12 12 12 13 13 13 13 13 13 9D 14 14 14 C2.9D 14 0A 25 15 15 0A 15 ** 08 16 16 16 08 16 87 17 17 17 C2.87 17 18 18 18 18 18 18 19 19 19 19 19 19 92 1A 1A 1A C2.92 1A 8F 1B 1B 1B C2.8F 1B 1C 1C 1C 1C 1C 1C 1D 1D 1D 1D 1D 1D 1E 1E 1E 1E 1E 1E 1F 1F 1F 1F 1F 1F 80 20 20 20 C2.80 20 81 21 21 21 C2.81 21 82 22 22 22 C2.82 22 83 23 23 23 C2.83 23 84 24 24 24 C2.84 24 85 15 25 25 C2.85 25 ** 17 26 26 26 17 26 1B 27 27 27 1B 27 88 28 28 28 C2.88 28 89 29 29 29 C2.89 29 8A 2A 2A 2A C2.8A 2A 8B 2B 2B 2B C2.8B 2B 8C 2C 2C 2C C2.8C 2C 05 2D 2D 2D 05 2D 06 2E 2E 2E 06 2E 07 2F 2F 2F 07 2F 90 30 30 30 C2.90 30 91 31 31 31 C2.91 31 16 32 32 32 16 32 93 33 33 33 C2.93 33 94 34 34 34 C2.94 34 95 35 35 35 C2.95 35 96 36 36 36 C2.96 36 04 37 37 37 04 37 98 38 38 38 C2.98 38 99 39 39 39 C2.99 39 9A 3A 3A 3A C2.9A 3A 9B 3B 3B 3B C2.9B 3B 14 3C 3C 3C 14 3C 15 3D 3D 3D 15 3D 9E 3E 3E 3E C2.9E 3E 1A 3F 3F 3F 1A 3F 20 40 40 40 20 40 A0 41 41 41 C2.A0 80.41 E2 42 42 42 C3.A2 8B.43 E4 43 43 43 C3.A4 8B.45 E0 44 44 44 C3.A0 8B.41 E1 45 45 45 C3.A1 8B.42 E3 46 46 46 C3.A3 8B.44 E5 47 47 47 C3.A5 8B.46 E7 48 48 48 C3.A7 8B.48 F1 49 49 49 C3.B1 8B.58 A2 4A 4A B0 C2.A2 80.43 ## . 2E 4B 4B 4B 2E 4B E9 51 51 51 C3.A9 8B.4A EA 52 52 52 C3.AA 8B.51 EB 53 53 53 C3.AB 8B.52 E8 54 54 54 C3.A8 8B.49 ED 55 55 55 C3.AD 8B.54 EE 56 56 56 C3.AE 8B.55 EF 57 57 57 C3.AF 8B.56 EC 58 58 58 C3.AC 8B.53 DF 59 59 59 C3.9F 8A.73 ! 21 5A 5A 5A 21 5A $ 24 5B 5B 5B 24 5B * 2A 5C 5C 5C 2A 5C ) 29 5D 5D 5D 29 5D ; 3B 5E 5E 5E 3B 5E ^ 5E B0 5F 6A 5E 5F ** ## - 2D 60 60 60 2D 60 / 2F 61 61 61 2F 61 C2 62 62 62 C3.82 8A.43 C4 63 63 63 C3.84 8A.45 C0 64 64 64 C3.80 8A.41 C1 65 65 65 C3.81 8A.42 C3 66 66 66 C3.83 8A.44 C5 67 67 67 C3.85 8A.46