/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements . See the NOTICE file distributed with
* this work for additional information regarding copyright ownership .
* The ASF licenses this file to You under the Apache License , Version 2 . 0
* ( the " License " ) ; you may not use this file except in compliance with
* the License . You may obtain a copy of the License at
*
* http : //www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing , software
* distributed under the License is distributed on an " AS IS " BASIS ,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied .
* See the License for the specific language governing permissions and
* limitations under the License .
*/
#include "ap_config.h"
#if APR_CHARSET_EBCDIC
#include "ebcdic.h"
/*
Initial Port for Apache - 1 . 3 by < Martin . Kraemer Mch . SNI . De >
" BS2000 OSD " is a POSIX on a main frame . It is made by Siemens AG , Germany .
Within the POSIX subsystem , the same character set was chosen as in
" native BS2000 " , namely EBCDIC .
EBCDIC Table . ( Yes , in EBCDIC , the letters ' a ' . . ' z ' are not contiguous ! )
This apr_table_t is bijective , i . e . there are no ambiguous or duplicate characters
00 00 01 02 03 85 09 86 7 f 87 8 d 8 e 0 b 0 c 0 d 0 e 0 f * . . . . . . . . . . . . . . . . *
10 10 11 12 13 8 f 0 a 08 97 18 19 9 c 9 d 1 c 1 d 1 e 1 f * . . . . . . . . . . . . . . . . *
20 80 81 82 83 84 92 17 1 b 88 89 8 a 8 b 8 c 05 06 07 * . . . . . . . . . . . . . . . . *
30 90 91 16 93 94 95 96 04 98 99 9 a 9 b 14 15 9 e 1 a * . . . . . . . . . . . . . . . . *
40 20 a0 e2 e4 e0 e1 e3 e5 e7 f1 60 2 e 3 c 28 2 b 7 c * . . . . . . . . . ` . < ( + | *
50 26 e9 ea eb e8 ed ee ef ec df 21 24 2 a 29 3 b 9 f * & . . . . . . . . . ! $ * ) ; . *
60 2 d 2 f c2 c4 c0 c1 c3 c5 c7 d1 5 e 2 c 25 5 f 3 e 3 f * - / . . . . . . . . ^ , % _ > ? *
70 f8 c9 ca cb c8 cd ce cf cc a8 3 a 23 40 27 3 d 22 * . . . . . . . . . . : # @ ' = " *
80 d8 61 62 63 64 65 66 67 68 69 ab bb f0 fd fe b1 * . abcdefghi . . . . . . *
90 b0 6 a 6 b 6 c 6 d 6 e 6 f 70 71 72 aa ba e6 b8 c6 a4 * . jklmnopqr . . . . . . *
a0 b5 af 73 74 75 76 77 78 79 7 a a1 bf d0 dd de ae * . . stuvwxyz . . . . . . *
b0 a2 a3 a5 b7 a9 a7 b6 bc bd be ac 5 b 5 c 5 d b4 d7 * . . . . . . . . . . . [ \ ] . . *
c0 f9 41 42 43 44 45 46 47 48 49 ad f4 f6 f2 f3 f5 * . ABCDEFGHI . . . . . . *
d0 a6 4 a 4 b 4 c 4 d 4 e 4 f 50 51 52 b9 fb fc db fa ff * . JKLMNOPQR . . . . . . *
e0 d9 f7 53 54 55 56 57 58 59 5 a b2 d4 d6 d2 d3 d5 * . . STUVWXYZ . . . . . . *
f0 30 31 32 33 34 35 36 37 38 39 b3 7 b dc 7 d da 7 e * 0123456789 . { . } . ~ *
*/
/* The bijective ebcdic-to-ascii table: */
const unsigned char os_toascii_strictly[256 ] = {
/*00*/ 0x00, 0x01, 0x02, 0x03, 0x85, 0x09, 0x86, 0x7f,
0 x87, 0 x8d, 0 x8e, 0 x0b, 0 x0c, 0 x0d, 0 x0e, 0 x0f, /*................*/
/*10*/ 0x10, 0x11, 0x12, 0x13, 0x8f, 0x0a, 0x08, 0x97,
0 x18, 0 x19, 0 x9c, 0 x9d, 0 x1c, 0 x1d, 0 x1e, 0 x1f, /*................*/
/*20*/ 0x80, 0x81, 0x82, 0x83, 0x84, 0x92, 0x17, 0x1b,
0 x88, 0 x89, 0 x8a, 0 x8b, 0 x8c, 0 x05, 0 x06, 0 x07, /*................*/
/*30*/ 0x90, 0x91, 0x16, 0x93, 0x94, 0x95, 0x96, 0x04,
0 x98, 0 x99, 0 x9a, 0 x9b, 0 x14, 0 x15, 0 x9e, 0 x1a, /*................*/
/*40*/ 0x20, 0xa0, 0xe2, 0xe4, 0xe0, 0xe1, 0xe3, 0xe5,
0 xe7, 0 xf1, 0 x60, 0 x2e, 0 x3c, 0 x28, 0 x2b, 0 x7c, /* .........`.<(+|*/
/*50*/ 0x26, 0xe9, 0xea, 0xeb, 0xe8, 0xed, 0xee, 0xef,
0 xec, 0 xdf, 0 x21, 0 x24, 0 x2a, 0 x29, 0 x3b, 0 x9f, /*&.........!$*);.*/
/*60*/ 0x2d, 0x2f, 0xc2, 0xc4, 0xc0, 0xc1, 0xc3, 0xc5,
0 xc7, 0 xd1, 0 x5e, 0 x2c, 0 x25, 0 x5f, 0 x3e, 0 x3f, /*-/........^,%_>?*/
/*70*/ 0xf8, 0xc9, 0xca, 0xcb, 0xc8, 0xcd, 0xce, 0xcf,
0 xcc, 0 xa8, 0 x3a, 0 x23, 0 x40, 0 x27, 0 x3d, 0 x22, /*..........:#@'="*/
/*80*/ 0xd8, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
0 x68, 0 x69, 0 xab, 0 xbb, 0 xf0, 0 xfd, 0 xfe, 0 xb1, /*.abcdefghi......*/
/*90*/ 0xb0, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70,
0 x71, 0 x72, 0 xaa, 0 xba, 0 xe6, 0 xb8, 0 xc6, 0 xa4, /*.jklmnopqr......*/
/*a0*/ 0xb5, 0xaf, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
0 x79, 0 x7a, 0 xa1, 0 xbf, 0 xd0, 0 xdd, 0 xde, 0 xae, /*..stuvwxyz......*/
/*b0*/ 0xa2, 0xa3, 0xa5, 0xb7, 0xa9, 0xa7, 0xb6, 0xbc,
0 xbd, 0 xbe, 0 xac, 0 x5b, 0 x5c, 0 x5d, 0 xb4, 0 xd7, /*...........[\]..*/
/*c0*/ 0xf9, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
0 x48, 0 x49, 0 xad, 0 xf4, 0 xf6, 0 xf2, 0 xf3, 0 xf5, /*.ABCDEFGHI......*/
/*d0*/ 0xa6, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50,
0 x51, 0 x52, 0 xb9, 0 xfb, 0 xfc, 0 xdb, 0 xfa, 0 xff, /*.JKLMNOPQR......*/
/*e0*/ 0xd9, 0xf7, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
0 x59, 0 x5a, 0 xb2, 0 xd4, 0 xd6, 0 xd2, 0 xd3, 0 xd5, /*..STUVWXYZ......*/
/*f0*/ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
0 x38, 0 x39, 0 xb3, 0 x7b, 0 xdc, 0 x7d, 0 xda, 0 x7e /*0123456789.{.}.~*/
};
/* This apr_table_t is (almost) identical to the previous one. The only difference
* is the fact that it maps every EBCDIC * except 0 x0A * to its ASCII
* equivalent . The reason for this apr_table_t is simple : Throughout the
* server , protocol strings are used in the form
* " Content - Type : text / plain \ 015 \ 012 " . Now all the characters in the string
* are stored as EBCDIC , only the semantics of \ 012 is completely
* different from LF ( look it up in the apr_table_t above ) . \ 015 happens to be
* mapped to \ 015 anyway , so there ' s no special case for it .
*
* In THIS table , EBCDIC - \ 012 is mapped to ASCII - \ 012 .
* This apr_table_t is therefore used wherever an EBCDIC to ASCII conversion is
* needed in the server .
*/
/* ebcdic-to-ascii with \012 mapped to ASCII-\n */
const unsigned char os_toascii[256 ] = {
/*00*/ 0x00, 0x01, 0x02, 0x03, 0x85, 0x09, 0x86, 0x7f,
0 x87, 0 x8d, 0 x0a, 0 x0b, 0 x0c, 0 x0d, 0 x0e, 0 x0f, /*................*/
/*10*/ 0x10, 0x11, 0x12, 0x13, 0x8f, 0x0a, 0x08, 0x97,
0 x18, 0 x19, 0 x9c, 0 x9d, 0 x1c, 0 x1d, 0 x1e, 0 x1f, /*................*/
/*20*/ 0x80, 0x81, 0x82, 0x83, 0x84, 0x92, 0x17, 0x1b,
0 x88, 0 x89, 0 x8a, 0 x8b, 0 x8c, 0 x05, 0 x06, 0 x07, /*................*/
/*30*/ 0x90, 0x91, 0x16, 0x93, 0x94, 0x95, 0x96, 0x04,
0 x98, 0 x99, 0 x9a, 0 x9b, 0 x14, 0 x15, 0 x9e, 0 x1a, /*................*/
/*40*/ 0x20, 0xa0, 0xe2, 0xe4, 0xe0, 0xe1, 0xe3, 0xe5,
0 xe7, 0 xf1, 0 x60, 0 x2e, 0 x3c, 0 x28, 0 x2b, 0 x7c, /* .........`.<(+|*/
/*50*/ 0x26, 0xe9, 0xea, 0xeb, 0xe8, 0xed, 0xee, 0xef,
0 xec, 0 xdf, 0 x21, 0 x24, 0 x2a, 0 x29, 0 x3b, 0 x9f, /*&.........!$*);.*/
/*60*/ 0x2d, 0x2f, 0xc2, 0xc4, 0xc0, 0xc1, 0xc3, 0xc5,
0 xc7, 0 xd1, 0 x5e, 0 x2c, 0 x25, 0 x5f, 0 x3e, 0 x3f, /*-/........^,%_>?*/
/*70*/ 0xf8, 0xc9, 0xca, 0xcb, 0xc8, 0xcd, 0xce, 0xcf,
0 xcc, 0 xa8, 0 x3a, 0 x23, 0 x40, 0 x27, 0 x3d, 0 x22, /*..........:#@'="*/
/*80*/ 0xd8, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
0 x68, 0 x69, 0 xab, 0 xbb, 0 xf0, 0 xfd, 0 xfe, 0 xb1, /*.abcdefghi......*/
/*90*/ 0xb0, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70,
0 x71, 0 x72, 0 xaa, 0 xba, 0 xe6, 0 xb8, 0 xc6, 0 xa4, /*.jklmnopqr......*/
/*a0*/ 0xb5, 0xaf, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
0 x79, 0 x7a, 0 xa1, 0 xbf, 0 xd0, 0 xdd, 0 xde, 0 xae, /*..stuvwxyz......*/
/*b0*/ 0xa2, 0xa3, 0xa5, 0xb7, 0xa9, 0xa7, 0xb6, 0xbc,
0 xbd, 0 xbe, 0 xac, 0 x5b, 0 x5c, 0 x5d, 0 xb4, 0 xd7, /*...........[\]..*/
/*c0*/ 0xf9, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
0 x48, 0 x49, 0 xad, 0 xf4, 0 xf6, 0 xf2, 0 xf3, 0 xf5, /*.ABCDEFGHI......*/
/*d0*/ 0xa6, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50,
0 x51, 0 x52, 0 xb9, 0 xfb, 0 xfc, 0 xdb, 0 xfa, 0 xff, /*.JKLMNOPQR......*/
/*e0*/ 0xd9, 0xf7, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
0 x59, 0 x5a, 0 xb2, 0 xd4, 0 xd6, 0 xd2, 0 xd3, 0 xd5, /*..STUVWXYZ......*/
/*f0*/ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
0 x38, 0 x39, 0 xb3, 0 x7b, 0 xdc, 0 x7d, 0 xda, 0 x7e /*0123456789.{.}.~*/
};
/* The ascii-to-ebcdic table:
00 00 01 02 03 37 2 d 2 e 2 f 16 05 15 0 b 0 c 0 d 0 e 0 f * . . . . . . . . . . . . . . . . *
10 10 11 12 13 3 c 3 d 32 26 18 19 3 f 27 1 c 1 d 1 e 1 f * . . . . . . . . . . . . . . . . *
20 40 5 a 7 f 7 b 5 b 6 c 50 7 d 4 d 5 d 5 c 4 e 6 b 60 4 b 61 * ! " # $ % & ' ( ) * + , - . /
30 f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 7 a 5 e 4 c 7 e 6 e 6 f * 0123456789 : ; < = > ? *
40 7 c c1 c2 c3 c4 c5 c6 c7 c8 c9 d1 d2 d3 d4 d5 d6 * @ ABCDEFGHIJKLMNO *
50 d7 d8 d9 e2 e3 e4 e5 e6 e7 e8 e9 bb bc bd 6 a 6 d * PQRSTUVWXYZ [ \ ] ^ _ *
60 4 a 81 82 83 84 85 86 87 88 89 91 92 93 94 95 96 * ` abcdefghijklmno *
70 97 98 99 a2 a3 a4 a5 a6 a7 a8 a9 fb 4 f fd ff 07 * pqrstuvwxyz { | } ~ . *
80 20 21 22 23 24 04 06 08 28 29 2 a 2 b 2 c 09 0 a 14 * . . . . . . . . . . . . . . . . *
90 30 31 25 33 34 35 36 17 38 39 3 a 3 b 1 a 1 b 3 e 5 f * . . . . . . . . . . . . . . . . *
a0 41 aa b0 b1 9 f b2 d0 b5 79 b4 9 a 8 a ba ca af a1 * . . . . . . . . . . . . . . . . *
b0 90 8 f ea fa be a0 b6 b3 9 d da 9 b 8 b b7 b8 b9 ab * . . . . . . . . . . . . . . . . *
c0 64 65 62 66 63 67 9 e 68 74 71 72 73 78 75 76 77 * . . . . . . . . . . . . . . . . *
d0 ac 69 ed ee eb ef ec bf 80 e0 fe dd fc ad ae 59 * . . . . . . . . . . . . . . . . *
e0 44 45 42 46 43 47 9 c 48 54 51 52 53 58 55 56 57 * . . . . . . . . . . . . . . . . *
f0 8 c 49 cd ce cb cf cc e1 70 c0 de db dc 8 d 8 e df * . . . . . . . . . . . . . . . . *
*/
const unsigned char os_toebcdic[256 ] = {
/*00*/ 0x00, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f,
0 x16, 0 x05, 0 x15, 0 x0b, 0 x0c, 0 x0d, 0 x0e, 0 x0f, /*................*/
/*10*/ 0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26,
0 x18, 0 x19, 0 x3f, 0 x27, 0 x1c, 0 x1d, 0 x1e, 0 x1f, /*................*/
/*20*/ 0x40, 0x5a, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d,
0 x4d, 0 x5d, 0 x5c, 0 x4e, 0 x6b, 0 x60, 0 x4b, 0 x61, /* !"#$%&'()*+,-./ */
/*30*/ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
0 xf8, 0 xf9, 0 x7a, 0 x5e, 0 x4c, 0 x7e, 0 x6e, 0 x6f, /*0123456789:;<=>?*/
/*40*/ 0x7c, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
0 xc8, 0 xc9, 0 xd1, 0 xd2, 0 xd3, 0 xd4, 0 xd5, 0 xd6, /*@ABCDEFGHIJKLMNO*/
/*50*/ 0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6,
0 xe7, 0 xe8, 0 xe9, 0 xbb, 0 xbc, 0 xbd, 0 x6a, 0 x6d, /*PQRSTUVWXYZ[\]^_*/
/*60*/ 0x4a, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
0 x88, 0 x89, 0 x91, 0 x92, 0 x93, 0 x94, 0 x95, 0 x96, /*`abcdefghijklmno*/
/*70*/ 0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6,
0 xa7, 0 xa8, 0 xa9, 0 xfb, 0 x4f, 0 xfd, 0 xff, 0 x07, /*pqrstuvwxyz{|}~.*/
/*80*/ 0x20, 0x21, 0x22, 0x23, 0x24, 0x04, 0x06, 0x08,
0 x28, 0 x29, 0 x2a, 0 x2b, 0 x2c, 0 x09, 0 x0a, 0 x14, /*................*/
/*90*/ 0x30, 0x31, 0x25, 0x33, 0x34, 0x35, 0x36, 0x17,
0 x38, 0 x39, 0 x3a, 0 x3b, 0 x1a, 0 x1b, 0 x3e, 0 x5f, /*................*/
/*a0*/ 0x41, 0xaa, 0xb0, 0xb1, 0x9f, 0xb2, 0xd0, 0xb5,
0 x79, 0 xb4, 0 x9a, 0 x8a, 0 xba, 0 xca, 0 xaf, 0 xa1, /*................*/
/*b0*/ 0x90, 0x8f, 0xea, 0xfa, 0xbe, 0xa0, 0xb6, 0xb3,
0 x9d, 0 xda, 0 x9b, 0 x8b, 0 xb7, 0 xb8, 0 xb9, 0 xab, /*................*/
/*c0*/ 0x64, 0x65, 0x62, 0x66, 0x63, 0x67, 0x9e, 0x68,
0 x74, 0 x71, 0 x72, 0 x73, 0 x78, 0 x75, 0 x76, 0 x77, /*................*/
/*d0*/ 0xac, 0x69, 0xed, 0xee, 0xeb, 0xef, 0xec, 0xbf,
0 x80, 0 xe0, 0 xfe, 0 xdd, 0 xfc, 0 xad, 0 xae, 0 x59, /*................*/
/*e0*/ 0x44, 0x45, 0x42, 0x46, 0x43, 0x47, 0x9c, 0x48,
0 x54, 0 x51, 0 x52, 0 x53, 0 x58, 0 x55, 0 x56, 0 x57, /*................*/
/*f0*/ 0x8c, 0x49, 0xcd, 0xce, 0xcb, 0xcf, 0xcc, 0xe1,
0 x70, 0 xc0, 0 xde, 0 xdb, 0 xdc, 0 x8d, 0 x8e, 0 xdf /*................*/
};
/* Translate a memory block from EBCDIC (host charset) to ASCII (net charset)
* dest and srce may be identical , or separate memory blocks , but
* should not overlap .
*/
void
ebcdic2ascii(unsigned char *dest, const unsigned char *srce, size_t count)
{
while (count-- != 0 ) {
*dest++ = os_toascii[*srce++];
}
}
void
ebcdic2ascii_strictly(unsigned char *dest, const unsigned char *srce, size_t count)
{
while (count-- != 0 ) {
*dest++ = os_toascii_strictly[*srce++];
}
}
void
ascii2ebcdic(unsigned char *dest, const unsigned char *srce, size_t count)
{
while (count-- != 0 ) {
*dest++ = os_toebcdic[*srce++];
}
}
#endif /*APR_CHARSET_EBCDIC*/
Messung V0.5 in Prozent C=81 H=98 G=89
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.15Bemerkung:
(vorverarbeitet am 2026-06-10)
¤
*Bot Zugriff