1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * Copyright (c) 2001 by Sun Microsystems, Inc.
3*7c478bd9Sstevel@tonic-gate  * All rights reserved.
4*7c478bd9Sstevel@tonic-gate  */
5*7c478bd9Sstevel@tonic-gate 
6*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
7*7c478bd9Sstevel@tonic-gate 
8*7c478bd9Sstevel@tonic-gate /*
9*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the Netscape Public
10*7c478bd9Sstevel@tonic-gate  * License Version 1.1 (the "License"); you may not use this file
11*7c478bd9Sstevel@tonic-gate  * except in compliance with the License. You may obtain a copy of
12*7c478bd9Sstevel@tonic-gate  * the License at http://www.mozilla.org/NPL/
13*7c478bd9Sstevel@tonic-gate  *
14*7c478bd9Sstevel@tonic-gate  * Software distributed under the License is distributed on an "AS
15*7c478bd9Sstevel@tonic-gate  * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
16*7c478bd9Sstevel@tonic-gate  * implied. See the License for the specific language governing
17*7c478bd9Sstevel@tonic-gate  * rights and limitations under the License.
18*7c478bd9Sstevel@tonic-gate  *
19*7c478bd9Sstevel@tonic-gate  * The Original Code is Mozilla Communicator client code, released
20*7c478bd9Sstevel@tonic-gate  * March 31, 1998.
21*7c478bd9Sstevel@tonic-gate  *
22*7c478bd9Sstevel@tonic-gate  * The Initial Developer of the Original Code is Netscape
23*7c478bd9Sstevel@tonic-gate  * Communications Corporation. Portions created by Netscape are
24*7c478bd9Sstevel@tonic-gate  * Copyright (C) 1998-1999 Netscape Communications Corporation. All
25*7c478bd9Sstevel@tonic-gate  * Rights Reserved.
26*7c478bd9Sstevel@tonic-gate  *
27*7c478bd9Sstevel@tonic-gate  * Contributor(s):
28*7c478bd9Sstevel@tonic-gate  */
29*7c478bd9Sstevel@tonic-gate /*
30*7c478bd9Sstevel@tonic-gate  *  Copyright (c) 1995 Regents of the University of Michigan.
31*7c478bd9Sstevel@tonic-gate  *  All rights reserved.
32*7c478bd9Sstevel@tonic-gate  */
33*7c478bd9Sstevel@tonic-gate /*
34*7c478bd9Sstevel@tonic-gate  *  charset.c
35*7c478bd9Sstevel@tonic-gate  */
36*7c478bd9Sstevel@tonic-gate 
37*7c478bd9Sstevel@tonic-gate #include "ldap-int.h"
38*7c478bd9Sstevel@tonic-gate 
39*7c478bd9Sstevel@tonic-gate #ifdef STR_TRANSLATION
40*7c478bd9Sstevel@tonic-gate 
41*7c478bd9Sstevel@tonic-gate void
42*7c478bd9Sstevel@tonic-gate ldap_set_string_translators( LDAP *ld, BERTranslateProc encode_proc,
43*7c478bd9Sstevel@tonic-gate 	BERTranslateProc decode_proc )
44*7c478bd9Sstevel@tonic-gate {
45*7c478bd9Sstevel@tonic-gate 	if ( ld == NULL ) {
46*7c478bd9Sstevel@tonic-gate 		if ( !nsldapi_initialized ) {
47*7c478bd9Sstevel@tonic-gate 			nsldapi_initialize_defaults();
48*7c478bd9Sstevel@tonic-gate 		}
49*7c478bd9Sstevel@tonic-gate 		ld = &nsldapi_ld_defaults;
50*7c478bd9Sstevel@tonic-gate 	}
51*7c478bd9Sstevel@tonic-gate 
52*7c478bd9Sstevel@tonic-gate 	if ( NSLDAPI_VALID_LDAP_POINTER( ld )) {
53*7c478bd9Sstevel@tonic-gate 		ld->ld_lber_encode_translate_proc = encode_proc;
54*7c478bd9Sstevel@tonic-gate 		ld->ld_lber_decode_translate_proc = decode_proc;
55*7c478bd9Sstevel@tonic-gate 	}
56*7c478bd9Sstevel@tonic-gate }
57*7c478bd9Sstevel@tonic-gate 
58*7c478bd9Sstevel@tonic-gate 
59*7c478bd9Sstevel@tonic-gate void
60*7c478bd9Sstevel@tonic-gate ldap_enable_translation( LDAP *ld, LDAPMessage *entry, int enable )
61*7c478bd9Sstevel@tonic-gate {
62*7c478bd9Sstevel@tonic-gate 	char	*optionsp;
63*7c478bd9Sstevel@tonic-gate 
64*7c478bd9Sstevel@tonic-gate 	if ( ld == NULL ) {
65*7c478bd9Sstevel@tonic-gate 		if ( !nsldapi_initialized ) {
66*7c478bd9Sstevel@tonic-gate 			nsldapi_initialize_defaults();
67*7c478bd9Sstevel@tonic-gate 		}
68*7c478bd9Sstevel@tonic-gate 		ld = &nsldapi_ld_defaults;
69*7c478bd9Sstevel@tonic-gate 	}
70*7c478bd9Sstevel@tonic-gate 
71*7c478bd9Sstevel@tonic-gate 	optionsp = ( entry == NULLMSG ) ? &ld->ld_lberoptions :
72*7c478bd9Sstevel@tonic-gate 	    &entry->lm_ber->ber_options;
73*7c478bd9Sstevel@tonic-gate 
74*7c478bd9Sstevel@tonic-gate 	if ( enable ) {
75*7c478bd9Sstevel@tonic-gate 		*optionsp |= LBER_OPT_TRANSLATE_STRINGS;
76*7c478bd9Sstevel@tonic-gate 	} else {
77*7c478bd9Sstevel@tonic-gate 		*optionsp &= ~LBER_OPT_TRANSLATE_STRINGS;
78*7c478bd9Sstevel@tonic-gate 	}
79*7c478bd9Sstevel@tonic-gate }
80*7c478bd9Sstevel@tonic-gate 
81*7c478bd9Sstevel@tonic-gate 
82*7c478bd9Sstevel@tonic-gate int
83*7c478bd9Sstevel@tonic-gate ldap_translate_from_t61( LDAP *ld, char **bufp, unsigned long *lenp,
84*7c478bd9Sstevel@tonic-gate     int free_input )
85*7c478bd9Sstevel@tonic-gate {
86*7c478bd9Sstevel@tonic-gate 	ber_len_t length = (ber_len_t)*lenp;
87*7c478bd9Sstevel@tonic-gate 
88*7c478bd9Sstevel@tonic-gate 	if ( ld->ld_lber_decode_translate_proc == NULL ) {
89*7c478bd9Sstevel@tonic-gate 		return( LDAP_SUCCESS );
90*7c478bd9Sstevel@tonic-gate 	}
91*7c478bd9Sstevel@tonic-gate 
92*7c478bd9Sstevel@tonic-gate 	return( (*ld->ld_lber_decode_translate_proc)( bufp, &length, free_input ));
93*7c478bd9Sstevel@tonic-gate }
94*7c478bd9Sstevel@tonic-gate 
95*7c478bd9Sstevel@tonic-gate 
96*7c478bd9Sstevel@tonic-gate int
97*7c478bd9Sstevel@tonic-gate ldap_translate_to_t61( LDAP *ld, char **bufp, unsigned long *lenp,
98*7c478bd9Sstevel@tonic-gate     int free_input )
99*7c478bd9Sstevel@tonic-gate {
100*7c478bd9Sstevel@tonic-gate 	ber_len_t length = (ber_len_t)*lenp;
101*7c478bd9Sstevel@tonic-gate 
102*7c478bd9Sstevel@tonic-gate 	if ( ld->ld_lber_encode_translate_proc == NULL ) {
103*7c478bd9Sstevel@tonic-gate 		return( LDAP_SUCCESS );
104*7c478bd9Sstevel@tonic-gate 	}
105*7c478bd9Sstevel@tonic-gate 
106*7c478bd9Sstevel@tonic-gate 	return( (*ld->ld_lber_encode_translate_proc)( bufp, &length, free_input ));
107*7c478bd9Sstevel@tonic-gate }
108*7c478bd9Sstevel@tonic-gate 
109*7c478bd9Sstevel@tonic-gate 
110*7c478bd9Sstevel@tonic-gate /*
111*7c478bd9Sstevel@tonic-gate  ** Character translation routine notes:
112*7c478bd9Sstevel@tonic-gate  *
113*7c478bd9Sstevel@tonic-gate  * On entry:  bufp points to a "string" to be converted (not necessarily
114*7c478bd9Sstevel@tonic-gate  *  zero-terminated) and buflenp points to the length of the buffer.
115*7c478bd9Sstevel@tonic-gate  *
116*7c478bd9Sstevel@tonic-gate  * On exit:  bufp should point to a malloc'd result.  If free_input is
117*7c478bd9Sstevel@tonic-gate  *  non-zero then the original bufp will be freed.  *buflenp should be
118*7c478bd9Sstevel@tonic-gate  *  set to the new length.  Zero bytes in the input buffer must be left
119*7c478bd9Sstevel@tonic-gate  *  as zero bytes.
120*7c478bd9Sstevel@tonic-gate  *
121*7c478bd9Sstevel@tonic-gate  * Return values: any ldap error code (LDAP_SUCCESS if all goes well).
122*7c478bd9Sstevel@tonic-gate  */
123*7c478bd9Sstevel@tonic-gate 
124*7c478bd9Sstevel@tonic-gate 
125*7c478bd9Sstevel@tonic-gate #ifdef LDAP_CHARSET_8859
126*7c478bd9Sstevel@tonic-gate 
127*7c478bd9Sstevel@tonic-gate #if LDAP_CHARSET_8859 == 88591
128*7c478bd9Sstevel@tonic-gate #define ISO_8859 1
129*7c478bd9Sstevel@tonic-gate #elif LDAP_CHARSET_8859 == 88592
130*7c478bd9Sstevel@tonic-gate #define ISO_8859 2
131*7c478bd9Sstevel@tonic-gate #elif LDAP_CHARSET_8859 == 88593
132*7c478bd9Sstevel@tonic-gate #define ISO_8859 3
133*7c478bd9Sstevel@tonic-gate #elif LDAP_CHARSET_8859 == 88594
134*7c478bd9Sstevel@tonic-gate #define ISO_8859 4
135*7c478bd9Sstevel@tonic-gate #elif LDAP_CHARSET_8859 == 88595
136*7c478bd9Sstevel@tonic-gate #define ISO_8859 5
137*7c478bd9Sstevel@tonic-gate #elif LDAP_CHARSET_8859 == 88596
138*7c478bd9Sstevel@tonic-gate #define ISO_8859 6
139*7c478bd9Sstevel@tonic-gate #elif LDAP_CHARSET_8859 == 88597
140*7c478bd9Sstevel@tonic-gate #define ISO_8859 7
141*7c478bd9Sstevel@tonic-gate #elif LDAP_CHARSET_8859 == 88598
142*7c478bd9Sstevel@tonic-gate #define ISO_8859 8
143*7c478bd9Sstevel@tonic-gate #elif LDAP_CHARSET_8859 == 88599
144*7c478bd9Sstevel@tonic-gate #define ISO_8859 9
145*7c478bd9Sstevel@tonic-gate #elif LDAP_CHARSET_8859 == 885910
146*7c478bd9Sstevel@tonic-gate #define ISO_8859 10
147*7c478bd9Sstevel@tonic-gate #else
148*7c478bd9Sstevel@tonic-gate #define ISO_8859 0
149*7c478bd9Sstevel@tonic-gate #endif
150*7c478bd9Sstevel@tonic-gate 
151*7c478bd9Sstevel@tonic-gate /*
152*7c478bd9Sstevel@tonic-gate  * the following ISO_8859 to/afrom T.61 character set translation code is
153*7c478bd9Sstevel@tonic-gate  * based on the code found in Enrique Silvestre Mora's iso-t61.c, found
154*7c478bd9Sstevel@tonic-gate  * as part of this package:
155*7c478bd9Sstevel@tonic-gate  *   ftp://pereiii.uji.es/pub/uji-ftp/unix/ldap/iso-t61.translation.tar.Z
156*7c478bd9Sstevel@tonic-gate  * Enrique is now (10/95) at this address: enrique.silvestre@uv.es
157*7c478bd9Sstevel@tonic-gate  *
158*7c478bd9Sstevel@tonic-gate  * changes made by mcs@umich.edu 12 October 1995:
159*7c478bd9Sstevel@tonic-gate  *   Change calling conventions of iso8859_t61() and t61_iso8859() to
160*7c478bd9Sstevel@tonic-gate  *	match libldap conventions; rename to ldap_8859_to_t61() and
161*7c478bd9Sstevel@tonic-gate  *	ldap_t61_to_8859().
162*7c478bd9Sstevel@tonic-gate  *   Change conversion routines to deal with non-zero terminated strings.
163*7c478bd9Sstevel@tonic-gate  *   ANSI-ize functions and include prototypes.
164*7c478bd9Sstevel@tonic-gate  */
165*7c478bd9Sstevel@tonic-gate 
166*7c478bd9Sstevel@tonic-gate /* iso-t61.c - ISO-T61 translation routines (version: 0.2.1, July-1994) */
167*7c478bd9Sstevel@tonic-gate /*
168*7c478bd9Sstevel@tonic-gate  * Copyright (c) 1994 Enrique Silvestre Mora, Universitat Jaume I, Spain.
169*7c478bd9Sstevel@tonic-gate  * All rights reserved.
170*7c478bd9Sstevel@tonic-gate  *
171*7c478bd9Sstevel@tonic-gate  * Redistribution and use in source and binary forms are permitted
172*7c478bd9Sstevel@tonic-gate  * provided that this notice is preserved and that due credit is given
173*7c478bd9Sstevel@tonic-gate  * to the Universitat Jaume I. The name of the University
174*7c478bd9Sstevel@tonic-gate  * may not be used to endorse or promote products derived from this
175*7c478bd9Sstevel@tonic-gate  * software without specific prior written permission. This software
176*7c478bd9Sstevel@tonic-gate  * is provided ``as is'' without express or implied warranty.
177*7c478bd9Sstevel@tonic-gate */
178*7c478bd9Sstevel@tonic-gate 
179*7c478bd9Sstevel@tonic-gate 
180*7c478bd9Sstevel@tonic-gate #include <stdio.h>
181*7c478bd9Sstevel@tonic-gate #include <stdlib.h>
182*7c478bd9Sstevel@tonic-gate #include <string.h>
183*7c478bd9Sstevel@tonic-gate 
184*7c478bd9Sstevel@tonic-gate /* Character set used: ISO 8859-1, ISO 8859-2, ISO 8859-3, ... */
185*7c478bd9Sstevel@tonic-gate /* #define  ISO_8859      1 */
186*7c478bd9Sstevel@tonic-gate 
187*7c478bd9Sstevel@tonic-gate #ifndef ISO_8859
188*7c478bd9Sstevel@tonic-gate #  define ISO_8859     0
189*7c478bd9Sstevel@tonic-gate #endif
190*7c478bd9Sstevel@tonic-gate 
191*7c478bd9Sstevel@tonic-gate typedef unsigned char  Byte;
192*7c478bd9Sstevel@tonic-gate typedef struct { Byte  a, b; } Couple;
193*7c478bd9Sstevel@tonic-gate 
194*7c478bd9Sstevel@tonic-gate #ifdef NEEDPROTOS
195*7c478bd9Sstevel@tonic-gate static Byte *c_to_hh( Byte *o, Byte c );
196*7c478bd9Sstevel@tonic-gate static Byte *c_to_cc( Byte *o, Couple *cc, Byte c );
197*7c478bd9Sstevel@tonic-gate static int hh_to_c( Byte *h );
198*7c478bd9Sstevel@tonic-gate static Byte *cc_to_t61( Byte *o, Byte *s );
199*7c478bd9Sstevel@tonic-gate #else /* NEEDPROTOS */
200*7c478bd9Sstevel@tonic-gate static Byte *c_to_hh();
201*7c478bd9Sstevel@tonic-gate static Byte *c_to_cc();
202*7c478bd9Sstevel@tonic-gate static int hh_to_c();
203*7c478bd9Sstevel@tonic-gate static Byte *cc_to_t61();
204*7c478bd9Sstevel@tonic-gate #endif /* NEEDPROTOS */
205*7c478bd9Sstevel@tonic-gate 
206*7c478bd9Sstevel@tonic-gate /*
207*7c478bd9Sstevel@tonic-gate    Character choosed as base in diacritics alone: NO-BREAK SPACE.
208*7c478bd9Sstevel@tonic-gate    (The standard say it must be a blank space, 0x20.)
209*7c478bd9Sstevel@tonic-gate */
210*7c478bd9Sstevel@tonic-gate #define  ALONE  0xA0
211*7c478bd9Sstevel@tonic-gate 
212*7c478bd9Sstevel@tonic-gate static Couple diacritic[16] = {
213*7c478bd9Sstevel@tonic-gate #if (ISO_8859 == 1) || (ISO_8859 == 9)
214*7c478bd9Sstevel@tonic-gate 	{0,0},       {'`',0},     {0xb4,0},    {'^',0},
215*7c478bd9Sstevel@tonic-gate 	{'~',0},     {0xaf,0},    {'(',ALONE}, {'.',ALONE},
216*7c478bd9Sstevel@tonic-gate 	{0xa8,0},    {0,0},       {'0',ALONE}, {0xb8,0},
217*7c478bd9Sstevel@tonic-gate 	{0,0},       {'"',ALONE}, {';',ALONE}, {'<',ALONE},
218*7c478bd9Sstevel@tonic-gate #elif (ISO_8859 == 2)
219*7c478bd9Sstevel@tonic-gate 	{0,0},       {'`',0},     {0xb4,0},    {'^',0},
220*7c478bd9Sstevel@tonic-gate 	{'~',0},     {'-',ALONE}, {0xa2,0},    {0xff,0},
221*7c478bd9Sstevel@tonic-gate 	{0xa8,0},    {0,0},       {'0',ALONE}, {0xb8,0},
222*7c478bd9Sstevel@tonic-gate 	{0,0},       {0xbd,0},    {0xb2,0},    {0xb7,0}
223*7c478bd9Sstevel@tonic-gate #elif (ISO_8859 == 3)
224*7c478bd9Sstevel@tonic-gate 	{0,0},       {'`',0},     {0xb4,0},    {'^',0},
225*7c478bd9Sstevel@tonic-gate 	{'~',0},     {'-',ALONE}, {0xa2,0},    {0xff,0},
226*7c478bd9Sstevel@tonic-gate 	{0xa8,0},    {0,0},       {'0',ALONE}, {0xb8,0},
227*7c478bd9Sstevel@tonic-gate 	{0,0},       {'"',ALONE}, {';',ALONE}, {'<',ALONE}
228*7c478bd9Sstevel@tonic-gate #elif (ISO_8859 == 4)
229*7c478bd9Sstevel@tonic-gate 	{0,0},       {'`',0},     {0xb4,0},    {'^',0},
230*7c478bd9Sstevel@tonic-gate 	{'~',0},     {0xaf,0},    {'(',ALONE}, {0xff,0},
231*7c478bd9Sstevel@tonic-gate 	{0xa8,0},    {0,0},       {'0',ALONE}, {0xb8,0},
232*7c478bd9Sstevel@tonic-gate 	{0,0},       {'"',ALONE}, {0xb2,0},    {0xb7,0}
233*7c478bd9Sstevel@tonic-gate #else
234*7c478bd9Sstevel@tonic-gate 	{0,0},       {'`',0},     {'\'',ALONE}, {'^',0},
235*7c478bd9Sstevel@tonic-gate 	{'~',0},     {'-',ALONE}, {'(',ALONE},  {'.',ALONE},
236*7c478bd9Sstevel@tonic-gate 	{':',ALONE}, {0,0},       {'0',ALONE},  {',',ALONE},
237*7c478bd9Sstevel@tonic-gate 	{0,0},       {'"',ALONE}, {';',ALONE},  {'<',ALONE}
238*7c478bd9Sstevel@tonic-gate #endif
239*7c478bd9Sstevel@tonic-gate };
240*7c478bd9Sstevel@tonic-gate 
241*7c478bd9Sstevel@tonic-gate /*
242*7c478bd9Sstevel@tonic-gate    --- T.61 (T.51) letters with diacritics: conversion to ISO 8859-n -----
243*7c478bd9Sstevel@tonic-gate        A,   C,   D,   E,   G,   H,   I,   J,   K,
244*7c478bd9Sstevel@tonic-gate        L,   N,   O,   R,   S,   T,   U,   W,   Y,   Z.
245*7c478bd9Sstevel@tonic-gate    -----------------------------------------------------------------------
246*7c478bd9Sstevel@tonic-gate */
247*7c478bd9Sstevel@tonic-gate static int letter_w_diacritic[16][38] = {
248*7c478bd9Sstevel@tonic-gate #if (ISO_8859 == 1)
249*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
250*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
251*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
252*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
253*7c478bd9Sstevel@tonic-gate 	0xc0,0,   0,   0xc8,0,   0,   0xcc,0,   0,
254*7c478bd9Sstevel@tonic-gate 	0,   0,   0xd2,0,   0,   0,   0xd9,0,   0,   0,
255*7c478bd9Sstevel@tonic-gate 	0xe0,0,   0,   0xe8,0,   0,   0xec,0,   0,
256*7c478bd9Sstevel@tonic-gate 	0,   0,   0xf2,0,   0,   0,   0xf9,0,   0,   0,
257*7c478bd9Sstevel@tonic-gate 	0xc1,-1,  0,   0xc9,0,   0,   0xcd,0,   0,
258*7c478bd9Sstevel@tonic-gate 	-1,  -1,  0xd3,-1,  -1,  0,   0xda,0,   0xdd,-1,
259*7c478bd9Sstevel@tonic-gate 	0xe1,-1,  0,   0xe9,0,   0,   0xed,0,   0,
260*7c478bd9Sstevel@tonic-gate 	-1,  -1,  0xf3,-1,  -1,  0,   0xfa,0,   0xfd,-1,
261*7c478bd9Sstevel@tonic-gate 	0xc2,-1,  0,   0xca,-1,  -1,  0xce,-1,  0,
262*7c478bd9Sstevel@tonic-gate 	0,   0,   0xd4,0,   -1,  0,   0xdb,-1,  -1,  0,
263*7c478bd9Sstevel@tonic-gate 	0xe2,-1,  0,   0xea,-1,  -1,  0xee,-1,  0,
264*7c478bd9Sstevel@tonic-gate 	0,   0,   0xf4,0,   -1,  0,   0xfb,-1,  -1,  0,
265*7c478bd9Sstevel@tonic-gate 	0xc3,0,   0,   0,   0,   0,   -1,  0,   0,
266*7c478bd9Sstevel@tonic-gate 	0,   0xd1,0xd5,0,   0,   0,   -1,  0,   0,   0,
267*7c478bd9Sstevel@tonic-gate 	0xe3,0,   0,   0,   0,   0,   -1,  0,   0,
268*7c478bd9Sstevel@tonic-gate 	0,   0xf1,0xf5,0,   0,   0,   -1,  0,   0,   0,
269*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   -1,  0,   0,   -1,  0,   0,
270*7c478bd9Sstevel@tonic-gate 	0,   0,   -1,  0,   0,   0,   -1,  0,   0,   0,
271*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   -1,  0,   0,   -1,  0,   0,
272*7c478bd9Sstevel@tonic-gate 	0,   0,   -1,  0,   0,   0,   -1,  0,   0,   0,
273*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   0,   -1,  0,   0,   0,   0,
274*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   -1,  0,   0,   0,
275*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   0,   -1,  0,   0,   0,   0,
276*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   -1,  0,   0,   0,
277*7c478bd9Sstevel@tonic-gate 	0,   -1,  0,   -1,  -1,  0,   -1,  0,   0,
278*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   -1,
279*7c478bd9Sstevel@tonic-gate 	0,   -1,  0,   -1,  -1,  0,   0,   0,   0,
280*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   -1,
281*7c478bd9Sstevel@tonic-gate 	0xc4,0,   0,   0xcb,0,   0,   0xcf,0,   0,
282*7c478bd9Sstevel@tonic-gate 	0,   0,   0xd6,0,   0,   0,   0xdc,0,   -1,  0,
283*7c478bd9Sstevel@tonic-gate 	0xe4,0,   0,   0xeb,0,   0,   0xef,0,   0,
284*7c478bd9Sstevel@tonic-gate 	0,   0,   0xf6,0,   0,   0,   0xfc,0,   0xff,0,
285*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
286*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
287*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
288*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
289*7c478bd9Sstevel@tonic-gate 	0xc5,0,   0,   0,   0,   0,   0,   0,   0,
290*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   -1,  0,   0,   0,
291*7c478bd9Sstevel@tonic-gate 	0xe5,0,   0,   0,   0,   0,   0,   0,   0,
292*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   -1,  0,   0,   0,
293*7c478bd9Sstevel@tonic-gate 	0,   0xc7,0,   0,   -1,  0,   0,   0,   -1,
294*7c478bd9Sstevel@tonic-gate 	-1,  -1,  0,   -1,  -1,  -1,  0,   0,   0,   0,
295*7c478bd9Sstevel@tonic-gate 	0,   0xe7,0,   0,   -1,  0,   0,   0,   -1,
296*7c478bd9Sstevel@tonic-gate 	-1,  -1,  0,   -1,  -1,  -1,  0,   0,   0,   0,
297*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
298*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
299*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
300*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
301*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
302*7c478bd9Sstevel@tonic-gate 	0,   0,   -1,  0,   0,   0,   -1,  0,   0,   0,
303*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
304*7c478bd9Sstevel@tonic-gate 	0,   0,   -1,  0,   0,   0,   -1,  0,   0,   0,
305*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   -1,  0,   0,   -1,  0,   0,
306*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   -1,  0,   0,   0,
307*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   -1,  0,   0,   -1,  0,   0,
308*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   -1,  0,   0,   0,
309*7c478bd9Sstevel@tonic-gate 	0,   -1,  -1,  -1,  0,   0,   0,   0,   0,
310*7c478bd9Sstevel@tonic-gate 	-1,  -1,  0,   -1,  -1,  -1,  0,   0,   0,   -1,
311*7c478bd9Sstevel@tonic-gate 	0,   -1,  -1,  -1,  0,   0,   0,   0,   0,
312*7c478bd9Sstevel@tonic-gate 	-1,  -1,  0,   -1,  -1,  -1,  0,   0,   0,   -1
313*7c478bd9Sstevel@tonic-gate #elif (ISO_8859 == 2)
314*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
315*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
316*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
317*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
318*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   -1,  0,   0,   -1,  0,   0,
319*7c478bd9Sstevel@tonic-gate 	0,   0,   -1,  0,   0,   0,   -1,  0,   0,   0,
320*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   -1,  0,   0,   -1,  0,   0,
321*7c478bd9Sstevel@tonic-gate 	0,   0,   -1,  0,   0,   0,   -1,  0,   0,   0,
322*7c478bd9Sstevel@tonic-gate 	0xc1,0xc6,0,   0xc9,0,   0,   0xcd,0,   0,
323*7c478bd9Sstevel@tonic-gate 	0xc5,0xd1,0xd3,0xc0,0xa6,0,   0xda,0,   0xdd,0xac,
324*7c478bd9Sstevel@tonic-gate 	0xe1,0xe6,0,   0xe9,0,   0,   0xed,0,   0,
325*7c478bd9Sstevel@tonic-gate 	0xe5,0xf1,0xf3,0xe0,0xb6,0,   0xfa,0,   0xfd,0xbc,
326*7c478bd9Sstevel@tonic-gate 	0xc2,-1,  0,   -1,  -1,  -1,  0xce,-1,  0,
327*7c478bd9Sstevel@tonic-gate 	0,   0,   0xd4,0,   -1,  0,   -1,  -1,  -1,  0,
328*7c478bd9Sstevel@tonic-gate 	0xe2,-1,  0,   -1,  -1,  -1,  0xee,-1,  0,
329*7c478bd9Sstevel@tonic-gate 	0,   0,   0xf4,0,   -1,  0,   -1,  -1,  -1,  0,
330*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   0,   0,   0,   -1,  0,   0,
331*7c478bd9Sstevel@tonic-gate 	0,   -1,  -1,  0,   0,   0,   -1,  0,   0,   0,
332*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   0,   0,   0,   -1,  0,   0,
333*7c478bd9Sstevel@tonic-gate 	0,   -1,  -1,  0,   0,   0,   -1,  0,   0,   0,
334*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   -1,  0,   0,   -1,  0,   0,
335*7c478bd9Sstevel@tonic-gate 	0,   0,   -1,  0,   0,   0,   -1,  0,   0,   0,
336*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   -1,  0,   0,   -1,  0,   0,
337*7c478bd9Sstevel@tonic-gate 	0,   0,   -1,  0,   0,   0,   -1,  0,   0,   0,
338*7c478bd9Sstevel@tonic-gate 	0xc3,0,   0,   0,   -1,  0,   0,   0,   0,
339*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   -1,  0,   0,   0,
340*7c478bd9Sstevel@tonic-gate 	0xe3,0,   0,   0,   -1,  0,   0,   0,   0,
341*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   -1,  0,   0,   0,
342*7c478bd9Sstevel@tonic-gate 	0,   -1,  0,   -1,  -1,  0,   -1,  0,   0,
343*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0xaf,
344*7c478bd9Sstevel@tonic-gate 	0,   -1,  0,   -1,  -1,  0,   0,   0,   0,
345*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0xbf,
346*7c478bd9Sstevel@tonic-gate 	0xc4,0,   0,   0xcb,0,   0,   -1,  0,   0,
347*7c478bd9Sstevel@tonic-gate 	0,   0,   0xd6,0,   0,   0,   0xdc,0,   -1,  0,
348*7c478bd9Sstevel@tonic-gate 	0xe4,0,   0,   0xeb,0,   0,   -1,  0,   0,
349*7c478bd9Sstevel@tonic-gate 	0,   0,   0xf6,0,   0,   0,   0xfc,0,   -1,  0,
350*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
351*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
352*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
353*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
354*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   0,   0,   0,   0,   0,   0,
355*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0xd9,0,   0,   0,
356*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   0,   0,   0,   0,   0,   0,
357*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0xf9,0,   0,   0,
358*7c478bd9Sstevel@tonic-gate 	0,   0xc7,0,   0,   -1,  0,   0,   0,   -1,
359*7c478bd9Sstevel@tonic-gate 	-1,  -1,  0,   -1,  0xaa,0xde,0,   0,   0,   0,
360*7c478bd9Sstevel@tonic-gate 	0,   0xe7,0,   0,   -1,  0,   0,   0,   -1,
361*7c478bd9Sstevel@tonic-gate 	-1,  -1,  0,   -1,  0xba,0xfe,0,   0,   0,   0,
362*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
363*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
364*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
365*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
366*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
367*7c478bd9Sstevel@tonic-gate 	0,   0,   0xd5,0,   0,   0,   0xdb,0,   0,   0,
368*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
369*7c478bd9Sstevel@tonic-gate 	0,   0,   0xf5,0,   0,   0,   0xfb,0,   0,   0,
370*7c478bd9Sstevel@tonic-gate 	0xa1,0,   0,   0xca,0,   0,   -1,  0,   0,
371*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   -1,  0,   0,   0,
372*7c478bd9Sstevel@tonic-gate 	0xb1,0,   0,   0xea,0,   0,   -1,  0,   0,
373*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   -1,  0,   0,   0,
374*7c478bd9Sstevel@tonic-gate 	0,   0xc8,0xcf,0xcc,0,   0,   0,   0,   0,
375*7c478bd9Sstevel@tonic-gate 	0xa5,0xd2,0,   0xd8,0xa9,0xab,0,   0,   0,   0xae,
376*7c478bd9Sstevel@tonic-gate 	0,   0xe8,0xef,0xec,0,   0,   0,   0,   0,
377*7c478bd9Sstevel@tonic-gate 	0xb5,0xf2,0,   0xf8,0xb9,0xbb,0,   0,   0,   0xbe
378*7c478bd9Sstevel@tonic-gate #elif (ISO_8859 == 3)
379*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
380*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
381*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
382*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
383*7c478bd9Sstevel@tonic-gate 	0xc0,0,   0,   0xc8,0,   0,   0xcc,0,   0,
384*7c478bd9Sstevel@tonic-gate 	0,   0,   0xd2,0,   0,   0,   0xd9,0,   0,   0,
385*7c478bd9Sstevel@tonic-gate 	0xe0,0,   0,   0xe8,0,   0,   0xec,0,   0,
386*7c478bd9Sstevel@tonic-gate 	0,   0,   0xf2,0,   0,   0,   0xf9,0,   0,   0,
387*7c478bd9Sstevel@tonic-gate 	0xc1,-1,  0,   0xc9,0,   0,   0xcd,0,   0,
388*7c478bd9Sstevel@tonic-gate 	-1,  -1,  0xd3,-1,  -1,  0,   0xda,0,   -1,  -1,
389*7c478bd9Sstevel@tonic-gate 	0xe1,-1,  0,   0xe9,0,   0,   0xed,0,   0,
390*7c478bd9Sstevel@tonic-gate 	-1,  -1,  0xf3,-1,  -1,  0,   0xfa,0,   -1,  -1,
391*7c478bd9Sstevel@tonic-gate 	0xc2,0xc6,0,   0xca,0xd8,0xa6,0xce,0xac,0,
392*7c478bd9Sstevel@tonic-gate 	0,   0,   0xd4,0,   0xde,0,   0xdb,-1,  -1,  0,
393*7c478bd9Sstevel@tonic-gate 	0xe2,0xe6,0,   0xea,0xf8,0xb6,0xee,0xbc,0,
394*7c478bd9Sstevel@tonic-gate 	0,   0,   0xf4,0,   0xfe,0,   0xfb,-1,  -1,  0,
395*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   0,   0,   0,   -1,  0,   0,
396*7c478bd9Sstevel@tonic-gate 	0,   0xd1,-1,  0,   0,   0,   -1,  0,   0,   0,
397*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   0,   0,   0,   -1,  0,   0,
398*7c478bd9Sstevel@tonic-gate 	0,   0xf1,-1,  0,   0,   0,   -1,  0,   0,   0,
399*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   -1,  0,   0,   -1,  0,   0,
400*7c478bd9Sstevel@tonic-gate 	0,   0,   -1,  0,   0,   0,   -1,  0,   0,   0,
401*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   -1,  0,   0,   -1,  0,   0,
402*7c478bd9Sstevel@tonic-gate 	0,   0,   -1,  0,   0,   0,   -1,  0,   0,   0,
403*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   0,   0xab,0,   0,   0,   0,
404*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0xdd,0,   0,   0,
405*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   0,   0xbb,0,   0,   0,   0,
406*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0xfd,0,   0,   0,
407*7c478bd9Sstevel@tonic-gate 	0,   0xc5,0,   -1,  0xd5,0,   0xa9,0,   0,
408*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0xaf,
409*7c478bd9Sstevel@tonic-gate 	0,   0xe5,0,   -1,  0xf5,0,   0,   0,   0,
410*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0xbf,
411*7c478bd9Sstevel@tonic-gate 	0xc4,0,   0,   0xcb,0,   0,   0xcf,0,   0,
412*7c478bd9Sstevel@tonic-gate 	0,   0,   0xd6,0,   0,   0,   0xdc,0,   -1,  0,
413*7c478bd9Sstevel@tonic-gate 	0xe4,0,   0,   0xeb,0,   0,   0xef,0,   0,
414*7c478bd9Sstevel@tonic-gate 	0,   0,   0xf6,0,   0,   0,   0xfc,0,   -1,  0,
415*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
416*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
417*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
418*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
419*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   0,   0,   0,   0,   0,   0,
420*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   -1,  0,   0,   0,
421*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   0,   0,   0,   0,   0,   0,
422*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   -1,  0,   0,   0,
423*7c478bd9Sstevel@tonic-gate 	0,   0xc7,0,   0,   -1,  0,   0,   0,   -1,
424*7c478bd9Sstevel@tonic-gate 	-1,  -1,  0,   -1,  0xaa,-1,  0,   0,   0,   0,
425*7c478bd9Sstevel@tonic-gate 	0,   0xe7,0,   0,   -1,  0,   0,   0,   -1,
426*7c478bd9Sstevel@tonic-gate 	-1,  -1,  0,   -1,  0xba,-1,  0,   0,   0,   0,
427*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
428*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
429*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
430*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
431*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
432*7c478bd9Sstevel@tonic-gate 	0,   0,   -1,  0,   0,   0,   -1,  0,   0,   0,
433*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
434*7c478bd9Sstevel@tonic-gate 	0,   0,   -1,  0,   0,   0,   -1,  0,   0,   0,
435*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   -1,  0,   0,   -1,  0,   0,
436*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   -1,  0,   0,   0,
437*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   -1,  0,   0,   -1,  0,   0,
438*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   -1,  0,   0,   0,
439*7c478bd9Sstevel@tonic-gate 	0,   -1,  -1,  -1,  0,   0,   0,   0,   0,
440*7c478bd9Sstevel@tonic-gate 	-1,  -1,  0,   -1,  -1,  -1,  0,   0,   0,   -1,
441*7c478bd9Sstevel@tonic-gate 	0,   -1,  -1,  -1,  0,   0,   0,   0,   0,
442*7c478bd9Sstevel@tonic-gate 	-1,  -1,  0,   -1,  -1,  -1,  0,   0,   0,   -1
443*7c478bd9Sstevel@tonic-gate #elif (ISO_8859 == 4)
444*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
445*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
446*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
447*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
448*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   -1,  0,   0,   -1,  0,   0,
449*7c478bd9Sstevel@tonic-gate 	0,   0,   -1,  0,   0,   0,   -1,  0,   0,   0,
450*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   -1,  0,   0,   -1,  0,   0,
451*7c478bd9Sstevel@tonic-gate 	0,   0,   -1,  0,   0,   0,   -1,  0,   0,   0,
452*7c478bd9Sstevel@tonic-gate 	0xc1,-1,  0,   0xc9,0,   0,   0xcd,0,   0,
453*7c478bd9Sstevel@tonic-gate 	-1,  -1,  -1,  -1,  -1,  0,   0xda,0,   -1,  -1,
454*7c478bd9Sstevel@tonic-gate 	0xe1,-1,  0,   0xe9,0,   0,   0xed,0,   0,
455*7c478bd9Sstevel@tonic-gate 	-1,  -1,  -1,  -1,  -1,  0,   0xfa,0,   -1,  -1,
456*7c478bd9Sstevel@tonic-gate 	0xc2,-1,  0,   -1,  -1,  -1,  0xce,-1,  0,
457*7c478bd9Sstevel@tonic-gate 	0,   0,   0xd4,0,   -1,  0,   0xdb,-1,  -1,  0,
458*7c478bd9Sstevel@tonic-gate 	0xe2,-1,  0,   -1,  -1,  -1,  0xee,-1,  0,
459*7c478bd9Sstevel@tonic-gate 	0,   0,   0xf4,0,   -1,  0,   0xfb,-1,  -1,  0,
460*7c478bd9Sstevel@tonic-gate 	0xc3,0,   0,   0,   0,   0,   0xa5,0,   0,
461*7c478bd9Sstevel@tonic-gate 	0,   -1,  0xd5,0,   0,   0,   0xdd,0,   0,   0,
462*7c478bd9Sstevel@tonic-gate 	0xe3,0,   0,   0,   0,   0,   0xb5,0,   0,
463*7c478bd9Sstevel@tonic-gate 	0,   -1,  0xf5,0,   0,   0,   0xfd,0,   0,   0,
464*7c478bd9Sstevel@tonic-gate 	0xc0,0,   0,   0xaa,0,   0,   0xcf,0,   0,
465*7c478bd9Sstevel@tonic-gate 	0,   0,   0xd2,0,   0,   0,   0xde,0,   0,   0,
466*7c478bd9Sstevel@tonic-gate 	0xe0,0,   0,   0xba,0,   0,   0xef,0,   0,
467*7c478bd9Sstevel@tonic-gate 	0,   0,   0xf2,0,   0,   0,   0xfe,0,   0,   0,
468*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   0,   -1,  0,   0,   0,   0,
469*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   -1,  0,   0,   0,
470*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   0,   -1,  0,   0,   0,   0,
471*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   -1,  0,   0,   0,
472*7c478bd9Sstevel@tonic-gate 	0,   -1,  0,   0xcc,-1,  0,   -1,  0,   0,
473*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   -1,
474*7c478bd9Sstevel@tonic-gate 	0,   -1,  0,   0xec,-1,  0,   0,   0,   0,
475*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   -1,
476*7c478bd9Sstevel@tonic-gate 	0xc4,0,   0,   0xcb,0,   0,   -1,  0,   0,
477*7c478bd9Sstevel@tonic-gate 	0,   0,   0xd6,0,   0,   0,   0xdc,0,   -1,  0,
478*7c478bd9Sstevel@tonic-gate 	0xe4,0,   0,   0xeb,0,   0,   -1,  0,   0,
479*7c478bd9Sstevel@tonic-gate 	0,   0,   0xf6,0,   0,   0,   0xfc,0,   -1,  0,
480*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
481*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
482*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
483*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
484*7c478bd9Sstevel@tonic-gate 	0xc5,0,   0,   0,   0,   0,   0,   0,   0,
485*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   -1,  0,   0,   0,
486*7c478bd9Sstevel@tonic-gate 	0xe5,0,   0,   0,   0,   0,   0,   0,   0,
487*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   -1,  0,   0,   0,
488*7c478bd9Sstevel@tonic-gate 	0,   -1,  0,   0,   0xab,0,   0,   0,   0xd3,
489*7c478bd9Sstevel@tonic-gate 	0xa6,0xd1,0,   0xa3,-1,  -1,  0,   0,   0,   0,
490*7c478bd9Sstevel@tonic-gate 	0,   -1,  0,   0,   0xbb,0,   0,   0,   0xf3,
491*7c478bd9Sstevel@tonic-gate 	0xb6,0xf1,0,   0xb3,-1,  -1,  0,   0,   0,   0,
492*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
493*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
494*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
495*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
496*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
497*7c478bd9Sstevel@tonic-gate 	0,   0,   -1,  0,   0,   0,   -1,  0,   0,   0,
498*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
499*7c478bd9Sstevel@tonic-gate 	0,   0,   -1,  0,   0,   0,   -1,  0,   0,   0,
500*7c478bd9Sstevel@tonic-gate 	0xa1,0,   0,   0xca,0,   0,   0xc7,0,   0,
501*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0xd9,0,   0,   0,
502*7c478bd9Sstevel@tonic-gate 	0xb1,0,   0,   0xea,0,   0,   0xe7,0,   0,
503*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0xf9,0,   0,   0,
504*7c478bd9Sstevel@tonic-gate 	0,   0xc8,-1,  -1,  0,   0,   0,   0,   0,
505*7c478bd9Sstevel@tonic-gate 	-1,  -1,  0,   -1,  0xa9,-1,  0,   0,   0,   0xae,
506*7c478bd9Sstevel@tonic-gate 	0,   0xe8,-1,  -1,  0,   0,   0,   0,   0,
507*7c478bd9Sstevel@tonic-gate 	-1,  -1,  0,   -1,  0xb9,-1,  0,   0,   0,   0xbe
508*7c478bd9Sstevel@tonic-gate #elif (ISO_8859 == 9)
509*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
510*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
511*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
512*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
513*7c478bd9Sstevel@tonic-gate 	0xc0,0,   0,   0xc8,0,   0,   0xcc,0,   0,
514*7c478bd9Sstevel@tonic-gate 	0,   0,   0xd2,0,   0,   0,   0xd9,0,   0,   0,
515*7c478bd9Sstevel@tonic-gate 	0xe0,0,   0,   0xe8,0,   0,   -1,  0,   0,
516*7c478bd9Sstevel@tonic-gate 	0,   0,   0xf2,0,   0,   0,   0xf9,0,   0,   0,
517*7c478bd9Sstevel@tonic-gate 	0xc1,-1,  0,   0xc9,0,   0,   0xcd,0,   0,
518*7c478bd9Sstevel@tonic-gate 	-1,  -1,  0xd3,-1,  -1,  0,   0xda,0,   -1,  -1,
519*7c478bd9Sstevel@tonic-gate 	0xe1,-1,  0,   0xe9,0,   0,   0xed,0,   0,
520*7c478bd9Sstevel@tonic-gate 	-1,  -1,  0xf3,-1,  -1,  0,   0xfa,0,   -1,  -1,
521*7c478bd9Sstevel@tonic-gate 	0xc2,-1,  0,   0xca,-1,  -1,  0xce,-1,  0,
522*7c478bd9Sstevel@tonic-gate 	0,   0,   0xd4,0,   -1,  0,   0xdb,-1,  -1,  0,
523*7c478bd9Sstevel@tonic-gate 	0xe2,-1,  0,   -1,  -1,  -1,  0xee,-1,  0,
524*7c478bd9Sstevel@tonic-gate 	0,   0,   0xf4,0,   -1,  0,   0xfb,-1,  -1,  0,
525*7c478bd9Sstevel@tonic-gate 	0xc3,0,   0,   0,   0,   0,   -1,  0,   0,
526*7c478bd9Sstevel@tonic-gate 	0,   0xd1,0xd5,0,   0,   0,   -1,  0,   0,   0,
527*7c478bd9Sstevel@tonic-gate 	0xe3,0,   0,   0,   0,   0,   -1,  0,   0,
528*7c478bd9Sstevel@tonic-gate 	0,   0xf1,0xf5,0,   0,   0,   -1,  0,   0,   0,
529*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   -1,  0,   0,   -1,  0,   0,
530*7c478bd9Sstevel@tonic-gate 	0,   0,   -1,  0,   0,   0,   -1,  0,   0,   0,
531*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   -1,  0,   0,   0xef,0,   0,
532*7c478bd9Sstevel@tonic-gate 	0,   0,   -1,  0,   0,   0,   -1,  0,   0,   0,
533*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   0,   0xd0,0,   0,   0,   0,
534*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   -1,  0,   0,   0,
535*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   0,   0xf0,0,   0,   0,   0,
536*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   -1,  0,   0,   0,
537*7c478bd9Sstevel@tonic-gate 	0,   -1,  0,   -1,  -1,  0,   0xdd,0,   0,
538*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   -1,
539*7c478bd9Sstevel@tonic-gate 	0,   -1,  0,   0xec,-1,  0,   0,   0,   0,
540*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   -1,
541*7c478bd9Sstevel@tonic-gate 	0xc4,0,   0,   0xcb,0,   0,   0xcf,0,   0,
542*7c478bd9Sstevel@tonic-gate 	0,   0,   0xd6,0,   0,   0,   0xdc,0,   -1,  0,
543*7c478bd9Sstevel@tonic-gate 	0xe4,0,   0,   0xeb,0,   0,   -1,  0,   0,
544*7c478bd9Sstevel@tonic-gate 	0,   0,   0xf6,0,   0,   0,   0xfc,0,   0xff,0,
545*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
546*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
547*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
548*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
549*7c478bd9Sstevel@tonic-gate 	0xc5,0,   0,   0,   0,   0,   0,   0,   0,
550*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   -1,  0,   0,   0,
551*7c478bd9Sstevel@tonic-gate 	0xe5,0,   0,   0,   0,   0,   0,   0,   0,
552*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   -1,  0,   0,   0,
553*7c478bd9Sstevel@tonic-gate 	0,   0xc7,0,   0,   -1,  0,   0,   0,   -1,
554*7c478bd9Sstevel@tonic-gate 	-1,  -1,  0,   -1,  0xde,-1,  0,   0,   0,   0,
555*7c478bd9Sstevel@tonic-gate 	0,   0xe7,0,   0,   -1,  0,   0,   0,   -1,
556*7c478bd9Sstevel@tonic-gate 	-1,  -1,  0,   -1,  0xfe,-1,  0,   0,   0,   0,
557*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
558*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
559*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
560*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
561*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
562*7c478bd9Sstevel@tonic-gate 	0,   0,   -1,  0,   0,   0,   -1,  0,   0,   0,
563*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
564*7c478bd9Sstevel@tonic-gate 	0,   0,   -1,  0,   0,   0,   -1,  0,   0,   0,
565*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   -1,  0,   0,   -1,  0,   0,
566*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   -1,  0,   0,   0,
567*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   0xea,0,   0,   -1,  0,   0,
568*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   -1,  0,   0,   0,
569*7c478bd9Sstevel@tonic-gate 	0,   -1,  -1,  -1,  0,   0,   0,   0,   0,
570*7c478bd9Sstevel@tonic-gate 	-1,  -1,  0,   -1,  -1,  -1,  0,   0,   0,   -1,
571*7c478bd9Sstevel@tonic-gate 	0,   -1,  -1,  -1,  0,   0,   0,   0,   0,
572*7c478bd9Sstevel@tonic-gate 	-1,  -1,  0,   -1,  -1,  -1,  0,   0,   0,   -1
573*7c478bd9Sstevel@tonic-gate #elif (ISO_8859 == 10)
574*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
575*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
576*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
577*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
578*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   -1,  0,   0,   -1,  0,   0,
579*7c478bd9Sstevel@tonic-gate 	0,   0,   -1,  0,   0,   0,   -1,  0,   0,   0,
580*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   -1,  0,   0,   -1,  0,   0,
581*7c478bd9Sstevel@tonic-gate 	0,   0,   -1,  0,   0,   0,   -1,  0,   0,   0,
582*7c478bd9Sstevel@tonic-gate 	0xc1,-1,  0,   0xc9,0,   0,   0xcd,0,   0,
583*7c478bd9Sstevel@tonic-gate 	-1,  -1,  0xd3,-1,  -1,  0,   0xda,0,   0xdd,-1,
584*7c478bd9Sstevel@tonic-gate 	0xe1,-1,  0,   0xe9,0,   0,   0xed,0,   0,
585*7c478bd9Sstevel@tonic-gate 	-1,  -1,  0xf3,-1,  -1,  0,   0xfa,0,   0xfd,-1,
586*7c478bd9Sstevel@tonic-gate 	0xc2,-1,  0,   -1,  -1,  -1,  0xce,-1,  0,
587*7c478bd9Sstevel@tonic-gate 	0,   0,   0xd4,0,   -1,  0,   0xdb,-1,  -1,  0,
588*7c478bd9Sstevel@tonic-gate 	0xe2,-1,  0,   -1,  -1,  -1,  0xee,-1,  0,
589*7c478bd9Sstevel@tonic-gate 	0,   0,   0xf4,0,   -1,  0,   0xfb,-1,  -1,  0,
590*7c478bd9Sstevel@tonic-gate 	0xc3,0,   0,   0,   0,   0,   0xa5,0,   0,
591*7c478bd9Sstevel@tonic-gate 	0,   -1,  0xd5,0,   0,   0,   0xd7,0,   0,   0,
592*7c478bd9Sstevel@tonic-gate 	0xe3,0,   0,   0,   0,   0,   0xb5,0,   0,
593*7c478bd9Sstevel@tonic-gate 	0,   -1,  0xf5,0,   0,   0,   0xf7,0,   0,   0,
594*7c478bd9Sstevel@tonic-gate 	0xc0,0,   0,   0xa2,0,   0,   0xa4,0,   0,
595*7c478bd9Sstevel@tonic-gate 	0,   0,   0xd2,0,   0,   0,   0xae,0,   0,   0,
596*7c478bd9Sstevel@tonic-gate 	0xe0,0,   0,   0xb2,0,   0,   0xb4,0,   0,
597*7c478bd9Sstevel@tonic-gate 	0,   0,   0xf2,0,   0,   0,   0xbe,0,   0,   0,
598*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   0,   -1,  0,   0,   0,   0,
599*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   -1,  0,   0,   0,
600*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   0,   -1,  0,   0,   0,   0,
601*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   -1,  0,   0,   0,
602*7c478bd9Sstevel@tonic-gate 	0,   -1,  0,   0xcc,-1,  0,   -1,  0,   0,
603*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   -1,
604*7c478bd9Sstevel@tonic-gate 	0,   -1,  0,   0xec,-1,  0,   0,   0,   0,
605*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   -1,
606*7c478bd9Sstevel@tonic-gate 	0xc4,0,   0,   0xcb,0,   0,   0xcf,0,   0,
607*7c478bd9Sstevel@tonic-gate 	0,   0,   0xd6,0,   0,   0,   0xdc,0,   -1,  0,
608*7c478bd9Sstevel@tonic-gate 	0xe4,0,   0,   0xeb,0,   0,   0xef,0,   0,
609*7c478bd9Sstevel@tonic-gate 	0,   0,   0xf6,0,   0,   0,   0xfc,0,   -1,  0,
610*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
611*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
612*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
613*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
614*7c478bd9Sstevel@tonic-gate 	0xc5,0,   0,   0,   0,   0,   0,   0,   0,
615*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   -1,  0,   0,   0,
616*7c478bd9Sstevel@tonic-gate 	0xe5,0,   0,   0,   0,   0,   0,   0,   0,
617*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   -1,  0,   0,   0,
618*7c478bd9Sstevel@tonic-gate 	0,   -1,  0,   0,   0xa3,0,   0,   0,   0xa6,
619*7c478bd9Sstevel@tonic-gate 	0xa8,0xd1,0,   -1,  -1,  -1,  0,   0,   0,   0,
620*7c478bd9Sstevel@tonic-gate 	0,   -1,  0,   0,   0xb3,0,   0,   0,   0xb6,
621*7c478bd9Sstevel@tonic-gate 	0xb8,0xf1,0,   -1,  -1,  -1,  0,   0,   0,   0,
622*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
623*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
624*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
625*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
626*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
627*7c478bd9Sstevel@tonic-gate 	0,   0,   -1,  0,   0,   0,   -1,  0,   0,   0,
628*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
629*7c478bd9Sstevel@tonic-gate 	0,   0,   -1,  0,   0,   0,   -1,  0,   0,   0,
630*7c478bd9Sstevel@tonic-gate 	0xa1,0,   0,   0xca,0,   0,   0xc7,0,   0,
631*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0xd9,0,   0,   0,
632*7c478bd9Sstevel@tonic-gate 	0xb1,0,   0,   0xea,0,   0,   0xe7,0,   0,
633*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0xf9,0,   0,   0,
634*7c478bd9Sstevel@tonic-gate 	0,   0xc8,-1,  -1,  0,   0,   0,   0,   0,
635*7c478bd9Sstevel@tonic-gate 	-1,  -1,  0,   -1,  0xaa,-1,  0,   0,   0,   0xac,
636*7c478bd9Sstevel@tonic-gate 	0,   0xe8,-1,  -1,  0,   0,   0,   0,   0,
637*7c478bd9Sstevel@tonic-gate 	-1,  -1,  0,   -1,  0xba,-1,  0,   0,   0,   0xbc
638*7c478bd9Sstevel@tonic-gate #else
639*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
640*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
641*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
642*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
643*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   -1,  0,   0,   -1,  0,   0,
644*7c478bd9Sstevel@tonic-gate 	0,   0,   -1,  0,   0,   0,   -1,  0,   0,   0,
645*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   -1,  0,   0,   -1,  0,   0,
646*7c478bd9Sstevel@tonic-gate 	0,   0,   -1,  0,   0,   0,   -1,  0,   0,   0,
647*7c478bd9Sstevel@tonic-gate 	-1,  -1,  0,   -1,  0,   0,   -1,  0,   0,
648*7c478bd9Sstevel@tonic-gate 	-1,  -1,  -1,  -1,  -1,  0,   -1,  0,   -1,  -1,
649*7c478bd9Sstevel@tonic-gate 	-1,  -1,  0,   -1,  0,   0,   -1,  0,   0,
650*7c478bd9Sstevel@tonic-gate 	-1,  -1,  -1,  -1,  -1,  0,   -1,  0,   -1,  -1,
651*7c478bd9Sstevel@tonic-gate 	-1,  -1,  0,   -1,  -1,  -1,  -1,  -1,  0,
652*7c478bd9Sstevel@tonic-gate 	0,   0,   -1,  0,   -1,  0,   -1,  -1,  -1,  0,
653*7c478bd9Sstevel@tonic-gate 	-1,  -1,  0,   -1,  -1,  -1,  -1,  -1,  0,
654*7c478bd9Sstevel@tonic-gate 	0,   0,   -1,  0,   -1,  0,   -1,  -1,  -1,  0,
655*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   0,   0,   0,   -1,  0,   0,
656*7c478bd9Sstevel@tonic-gate 	0,   -1,  -1,  0,   0,   0,   -1,  0,   0,   0,
657*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   0,   0,   0,   -1,  0,   0,
658*7c478bd9Sstevel@tonic-gate 	0,   -1,  -1,  0,   0,   0,   -1,  0,   0,   0,
659*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   -1,  0,   0,   -1,  0,   0,
660*7c478bd9Sstevel@tonic-gate 	0,   0,   -1,  0,   0,   0,   -1,  0,   0,   0,
661*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   -1,  0,   0,   -1,  0,   0,
662*7c478bd9Sstevel@tonic-gate 	0,   0,   -1,  0,   0,   0,   -1,  0,   0,   0,
663*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   0,   -1,  0,   0,   0,   0,
664*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   -1,  0,   0,   0,
665*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   0,   -1,  0,   0,   0,   0,
666*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   -1,  0,   0,   0,
667*7c478bd9Sstevel@tonic-gate 	0,   -1,  0,   -1,  -1,  0,   -1,  0,   0,
668*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   -1,
669*7c478bd9Sstevel@tonic-gate 	0,   -1,  0,   -1,  -1,  0,   0,   0,   0,
670*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   -1,
671*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   -1,  0,   0,   -1,  0,   0,
672*7c478bd9Sstevel@tonic-gate 	0,   0,   -1,  0,   0,   0,   -1,  0,   -1,  0,
673*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   -1,  0,   0,   -1,  0,   0,
674*7c478bd9Sstevel@tonic-gate 	0,   0,   -1,  0,   0,   0,   -1,  0,   -1,  0,
675*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
676*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
677*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
678*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
679*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   0,   0,   0,   0,   0,   0,
680*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   -1,  0,   0,   0,
681*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   0,   0,   0,   0,   0,   0,
682*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   -1,  0,   0,   0,
683*7c478bd9Sstevel@tonic-gate 	0,   -1,  0,   0,   -1,  0,   0,   0,   -1,
684*7c478bd9Sstevel@tonic-gate 	-1,  -1,  0,   -1,  -1,  -1,  0,   0,   0,   0,
685*7c478bd9Sstevel@tonic-gate 	0,   -1,  0,   0,   -1,  0,   0,   0,   -1,
686*7c478bd9Sstevel@tonic-gate 	-1,  -1,  0,   -1,  -1,  -1,  0,   0,   0,   0,
687*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
688*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
689*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
690*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
691*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
692*7c478bd9Sstevel@tonic-gate 	0,   0,   -1,  0,   0,   0,   -1,  0,   0,   0,
693*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   0,   0,   0,
694*7c478bd9Sstevel@tonic-gate 	0,   0,   -1,  0,   0,   0,   -1,  0,   0,   0,
695*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   -1,  0,   0,   -1,  0,   0,
696*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   -1,  0,   0,   0,
697*7c478bd9Sstevel@tonic-gate 	-1,  0,   0,   -1,  0,   0,   -1,  0,   0,
698*7c478bd9Sstevel@tonic-gate 	0,   0,   0,   0,   0,   0,   -1,  0,   0,   0,
699*7c478bd9Sstevel@tonic-gate 	0,   -1,  -1,  -1,  0,   0,   0,   0,   0,
700*7c478bd9Sstevel@tonic-gate 	-1,  -1,  0,   -1,  -1,  -1,  0,   0,   0,   -1,
701*7c478bd9Sstevel@tonic-gate 	0,   -1,  -1,  -1,  0,   0,   0,   0,   0,
702*7c478bd9Sstevel@tonic-gate 	-1,  -1,  0,   -1,  -1,  -1,  0,   0,   0,   -1
703*7c478bd9Sstevel@tonic-gate #endif
704*7c478bd9Sstevel@tonic-gate };
705*7c478bd9Sstevel@tonic-gate 
706*7c478bd9Sstevel@tonic-gate /*
707*7c478bd9Sstevel@tonic-gate --- T.61 characters [0xA0 .. 0xBF] -----------------
708*7c478bd9Sstevel@tonic-gate */
709*7c478bd9Sstevel@tonic-gate static Couple trans_t61a_iso8859[32] = {
710*7c478bd9Sstevel@tonic-gate #if (ISO_8859 == 1) || (ISO_8859 == 9)
711*7c478bd9Sstevel@tonic-gate 	{'N','S'}, {0xa1,0},  {0xa2,0},  {0xa3,0},
712*7c478bd9Sstevel@tonic-gate 	{'D','O'}, {0xa5,0},  {'C','u'}, {0xa7,0},
713*7c478bd9Sstevel@tonic-gate 	{0xa4,0},  {'\'','6'},{'"','6'}, {0xab,0},
714*7c478bd9Sstevel@tonic-gate 	{'<','-'}, {'-','!'}, {'-','>'}, {'-','v'},
715*7c478bd9Sstevel@tonic-gate 	{0xb0,0},  {0xb1,0},  {0xb2,0},  {0xb3,0},
716*7c478bd9Sstevel@tonic-gate 	{0xd7,0},  {0xb5,0},  {0xb6,0},  {0xb7,0},
717*7c478bd9Sstevel@tonic-gate 	{0xf7,0},  {'\'','9'},{'"','9'}, {0xbb,0},
718*7c478bd9Sstevel@tonic-gate 	{0xbc,0},  {0xbd,0},  {0xbe,0},  {0xbf,0}
719*7c478bd9Sstevel@tonic-gate #elif (ISO_8859 == 2) || (ISO_8859 == 4)
720*7c478bd9Sstevel@tonic-gate 	{'N','S'}, {'!','I'}, {'C','t'}, {'P','d'},
721*7c478bd9Sstevel@tonic-gate 	{'D','O'}, {'Y','e'}, {'C','u'}, {0xa7,0},
722*7c478bd9Sstevel@tonic-gate 	{0xa4,0},  {'\'','6'},{'"','6'}, {'<','<'},
723*7c478bd9Sstevel@tonic-gate 	{'<','-'}, {'-','!'}, {'-','>'}, {'-','v'},
724*7c478bd9Sstevel@tonic-gate 	{0xb0,0},  {'+','-'}, {'2','S'}, {'3','S'},
725*7c478bd9Sstevel@tonic-gate 	{0xd7,0},  {'M','y'}, {'P','I'}, {'.','M'},
726*7c478bd9Sstevel@tonic-gate 	{0xf7,0},  {'\'','9'},{'"','9'}, {'>','>'},
727*7c478bd9Sstevel@tonic-gate 	{'1','4'}, {'1','2'}, {'3','4'}, {'?','I'},
728*7c478bd9Sstevel@tonic-gate #elif (ISO_8859 == 3)
729*7c478bd9Sstevel@tonic-gate 	{'N','S'}, {'!','I'}, {'C','t'}, {0xa3,0},
730*7c478bd9Sstevel@tonic-gate 	{'D','O'}, {'Y','e'}, {'C','u'}, {0xa7,0},
731*7c478bd9Sstevel@tonic-gate 	{0xa4,0},  {'\'','6'},{'"','6'}, {'<','<'},
732*7c478bd9Sstevel@tonic-gate 	{'<','-'}, {'-','!'}, {'-','>'}, {'-','v'},
733*7c478bd9Sstevel@tonic-gate 	{0xb0,0},  {'+','-'}, {0xb2,0},  {0xb3,0},
734*7c478bd9Sstevel@tonic-gate 	{0xd7,0},  {0xb5,0},  {'P','I'}, {0xb7,0},
735*7c478bd9Sstevel@tonic-gate 	{0xf7,0},  {'\'','9'},{'"','9'}, {'>','>'},
736*7c478bd9Sstevel@tonic-gate 	{'1','4'}, {0xbd,0},  {'3','4'}, {'?','I'}
737*7c478bd9Sstevel@tonic-gate #elif (ISO_8859 == 10)
738*7c478bd9Sstevel@tonic-gate 	{'N','S'}, {'!','I'}, {'C','t'}, {'P','d'},
739*7c478bd9Sstevel@tonic-gate 	{'D','O'}, {'Y','e'}, {'C','u'}, {0xa7,0},
740*7c478bd9Sstevel@tonic-gate 	{'C','u'}, {'\'','6'},{'"','6'}, {'<','<'},
741*7c478bd9Sstevel@tonic-gate 	{'<','-'}, {'-','!'}, {'-','>'}, {'-','v'},
742*7c478bd9Sstevel@tonic-gate 	{0xb0,0},  {'+','-'}, {'2','S'}, {'3','S'},
743*7c478bd9Sstevel@tonic-gate 	{'*','X'}, {'M','y'}, {'P','I'}, {0xb7,0},
744*7c478bd9Sstevel@tonic-gate 	{'-',':'}, {'\'','9'},{'"','9'}, {'>','>'},
745*7c478bd9Sstevel@tonic-gate 	{'1','4'}, {'1','2'}, {'3','4'}, {'?','I'}
746*7c478bd9Sstevel@tonic-gate #else
747*7c478bd9Sstevel@tonic-gate 	{'N','S'}, {'!','I'}, {'C','t'}, {'P','d'},
748*7c478bd9Sstevel@tonic-gate 	{'D','O'}, {'Y','e'}, {'C','u'}, {'S','E'},
749*7c478bd9Sstevel@tonic-gate 	{'X','O'}, {'\'','6'},{'"','6'}, {'<','<'},
750*7c478bd9Sstevel@tonic-gate 	{'<','-'}, {'-','!'}, {'-','>'}, {'-','v'},
751*7c478bd9Sstevel@tonic-gate 	{'D','G'}, {'+','-'}, {'2','S'}, {'3','S'},
752*7c478bd9Sstevel@tonic-gate 	{'*','X'}, {'M','y'}, {'P','I'}, {'.','M'},
753*7c478bd9Sstevel@tonic-gate 	{'-',':'}, {'\'','9'},{'"','9'}, {'>','>'},
754*7c478bd9Sstevel@tonic-gate 	{'1','4'}, {'1','2'}, {'3','4'}, {'?','I'}
755*7c478bd9Sstevel@tonic-gate #endif
756*7c478bd9Sstevel@tonic-gate };
757*7c478bd9Sstevel@tonic-gate 
758*7c478bd9Sstevel@tonic-gate /*
759*7c478bd9Sstevel@tonic-gate --- T.61 characters [0xE0 .. 0xFF] -----------------
760*7c478bd9Sstevel@tonic-gate */
761*7c478bd9Sstevel@tonic-gate static Couple trans_t61b_iso8859[48] = {
762*7c478bd9Sstevel@tonic-gate #if (ISO_8859 == 1)
763*7c478bd9Sstevel@tonic-gate 	{'-','M'}, {0xb9,0},  {0xae,0},  {0xa9,0},
764*7c478bd9Sstevel@tonic-gate 	{'T','M'}, {'M','8'}, {0xac,0},  {0xa6,0},
765*7c478bd9Sstevel@tonic-gate 	{0,0},     {0,0},     {0,0},     {0,0},
766*7c478bd9Sstevel@tonic-gate 	{'1','8'}, {'3','8'}, {'5','8'}, {'7','8'},
767*7c478bd9Sstevel@tonic-gate 	{'O','m'}, {0xc6,0},  {0xd0,0},  {0xaa,0},
768*7c478bd9Sstevel@tonic-gate 	{'H','/'}, {0,0},     {'I','J'}, {'L','.'},
769*7c478bd9Sstevel@tonic-gate 	{'L','/'}, {0xd8,0},  {'O','E'}, {0xba,0},
770*7c478bd9Sstevel@tonic-gate 	{0xde,0},  {'T','/'}, {'N','G'}, {'\'','n'},
771*7c478bd9Sstevel@tonic-gate 	{'k','k'}, {0xe6,0},  {'d','/'}, {0xf0,0},
772*7c478bd9Sstevel@tonic-gate 	{'h','/'}, {'i','.'}, {'i','j'}, {'l','.'},
773*7c478bd9Sstevel@tonic-gate 	{'l','/'}, {0xf8,0},  {'o','e'}, {0xdf,0},
774*7c478bd9Sstevel@tonic-gate 	{0xfe,0},  {'t','/'}, {'n','g'}, {'-','-'}
775*7c478bd9Sstevel@tonic-gate #elif (ISO_8859 == 2)
776*7c478bd9Sstevel@tonic-gate 	{'-','M'}, {'1','S'}, {'R','g'}, {'C','o'},
777*7c478bd9Sstevel@tonic-gate 	{'T','M'}, {'M','8'}, {'N','O'}, {'B','B'},
778*7c478bd9Sstevel@tonic-gate 	{0,0},     {0,0},     {0,0},     {0,0},
779*7c478bd9Sstevel@tonic-gate 	{'1','8'}, {'3','8'}, {'5','8'}, {'7','8'},
780*7c478bd9Sstevel@tonic-gate 	{'O','m'}, {'A','E'}, {0xd0,0},  {'-','a'},
781*7c478bd9Sstevel@tonic-gate 	{'H','/'}, {0,0},     {'I','J'}, {'L','.'},
782*7c478bd9Sstevel@tonic-gate 	{0xa3,0},  {'O','/'}, {'O','E'}, {'-','o'},
783*7c478bd9Sstevel@tonic-gate 	{'T','H'}, {'T','/'}, {'N','G'}, {'\'','n'},
784*7c478bd9Sstevel@tonic-gate 	{'k','k'}, {'a','e'}, {0xf0,0},  {'d','-'},
785*7c478bd9Sstevel@tonic-gate 	{'h','/'}, {'i','.'}, {'i','j'}, {'l','.'},
786*7c478bd9Sstevel@tonic-gate 	{0xb3,0},  {'o','/'}, {'o','e'}, {0xdf,0},
787*7c478bd9Sstevel@tonic-gate 	{'t','h'}, {'t','/'}, {'n','g'}, {'-','-'}
788*7c478bd9Sstevel@tonic-gate #elif (ISO_8859 == 3)
789*7c478bd9Sstevel@tonic-gate 	{'-','M'}, {'1','S'}, {'R','g'}, {'C','o'},
790*7c478bd9Sstevel@tonic-gate 	{'T','M'}, {'M','8'}, {'N','O'}, {'B','B'},
791*7c478bd9Sstevel@tonic-gate 	{0,0},     {0,0},     {0,0},     {0,0},
792*7c478bd9Sstevel@tonic-gate 	{'1','8'}, {'3','8'}, {'5','8'}, {'7','8'},
793*7c478bd9Sstevel@tonic-gate 	{'O','m'}, {'A','E'}, {'D','/'}, {'-','a'},
794*7c478bd9Sstevel@tonic-gate 	{0xa1,0},  {0,0},     {'I','J'}, {'L','.'},
795*7c478bd9Sstevel@tonic-gate 	{'L','/'}, {'O','/'}, {'O','E'}, {'-','o'},
796*7c478bd9Sstevel@tonic-gate 	{'T','H'}, {'T','/'}, {'N','G'}, {'\'','n'},
797*7c478bd9Sstevel@tonic-gate 	{'k','k'}, {'a','e'}, {'d','/'}, {'d','-'},
798*7c478bd9Sstevel@tonic-gate 	{0xb1,0},  {0xb9,0},  {'i','j'}, {'l','.'},
799*7c478bd9Sstevel@tonic-gate 	{'l','/'}, {'o','/'}, {'o','e'}, {0xdf,0},
800*7c478bd9Sstevel@tonic-gate 	{'t','h'}, {'t','/'}, {'n','g'}, {'-','-'}
801*7c478bd9Sstevel@tonic-gate #elif (ISO_8859 == 4)
802*7c478bd9Sstevel@tonic-gate 	{'-','M'}, {'1','S'}, {'R','g'}, {'C','o'},
803*7c478bd9Sstevel@tonic-gate 	{'T','M'}, {'M','8'}, {'N','O'}, {'B','B'},
804*7c478bd9Sstevel@tonic-gate 	{0,0},     {0,0},     {0,0},     {0,0},
805*7c478bd9Sstevel@tonic-gate 	{'1','8'}, {'3','8'}, {'5','8'}, {'7','8'},
806*7c478bd9Sstevel@tonic-gate 	{'O','m'}, {0xc6,0},  {0xd0,0},  {'-','a'},
807*7c478bd9Sstevel@tonic-gate 	{'H','/'}, {0,0},     {'I','J'}, {'L','.'},
808*7c478bd9Sstevel@tonic-gate 	{'L','/'}, {0xd8,0},  {'O','E'}, {'-','o'},
809*7c478bd9Sstevel@tonic-gate 	{'T','H'}, {0xac,0},  {0xbd,0},  {'\'','n'},
810*7c478bd9Sstevel@tonic-gate 	{0xa2,0},  {0xe6,0},  {0xf0,0},  {'d','-'},
811*7c478bd9Sstevel@tonic-gate 	{'h','/'}, {'i','.'}, {'i','j'}, {'l','.'},
812*7c478bd9Sstevel@tonic-gate 	{'l','/'}, {0xf8,0},  {'o','e'}, {0xdf,0},
813*7c478bd9Sstevel@tonic-gate 	{'t','h'}, {0xbc,0},  {0xbf,0},  {'-','-'}
814*7c478bd9Sstevel@tonic-gate #elif (ISO_8859 == 9)
815*7c478bd9Sstevel@tonic-gate 	{'-','M'}, {0xb9,0},  {0xae,0},  {0xa9,0},
816*7c478bd9Sstevel@tonic-gate 	{'T','M'}, {'M','8'}, {0xac,0},  {0xa6,0},
817*7c478bd9Sstevel@tonic-gate 	{0,0},     {0,0},     {0,0},     {0,0},
818*7c478bd9Sstevel@tonic-gate 	{'1','8'}, {'3','8'}, {'5','8'}, {'7','8'},
819*7c478bd9Sstevel@tonic-gate 	{'O','m'}, {0xc6,0},  {'D','/'}, {0xaa,0},
820*7c478bd9Sstevel@tonic-gate 	{'H','/'}, {0,0},     {'I','J'}, {'L','.'},
821*7c478bd9Sstevel@tonic-gate 	{'L','/'}, {0xd8,0},  {'O','E'}, {0xba,0},
822*7c478bd9Sstevel@tonic-gate 	{'T','H'}, {'T','/'}, {'N','G'}, {'\'','n'},
823*7c478bd9Sstevel@tonic-gate 	{'k','k'}, {0xe6,0},  {'d','/'}, {'d','-'},
824*7c478bd9Sstevel@tonic-gate 	{'h','/'}, {0xfd,0},  {'i','j'}, {'l','.'},
825*7c478bd9Sstevel@tonic-gate 	{'l','/'}, {0xf8,0},  {'o','e'}, {0xdf,0},
826*7c478bd9Sstevel@tonic-gate 	{'t','h'}, {'t','/'}, {'n','g'}, {'-','-'}
827*7c478bd9Sstevel@tonic-gate #elif (ISO_8859 == 10)
828*7c478bd9Sstevel@tonic-gate 	{0xbd,0},  {'1','S'}, {'R','g'}, {'C','o'},
829*7c478bd9Sstevel@tonic-gate 	{'T','M'}, {'M','8'}, {'N','O'}, {'B','B'},
830*7c478bd9Sstevel@tonic-gate 	{0,0},     {0,0},     {0,0},     {0,0},
831*7c478bd9Sstevel@tonic-gate 	{'1','8'}, {'3','8'}, {'5','8'}, {'7','8'},
832*7c478bd9Sstevel@tonic-gate 	{'O','m'}, {0xc6,0},  {0xa9,0},  {'-','a'},
833*7c478bd9Sstevel@tonic-gate 	{'H','/'}, {0,0},     {'I','J'}, {'L','.'},
834*7c478bd9Sstevel@tonic-gate 	{'L','/'}, {0xd8,0},  {'O','E'}, {'-','o'},
835*7c478bd9Sstevel@tonic-gate 	{0xde,0},  {0xab,0},  {0xaf,0},  {'\'','n'},
836*7c478bd9Sstevel@tonic-gate 	{0xff,0},  {0xe6,0},  {0xb9,0},  {0xf0,0},
837*7c478bd9Sstevel@tonic-gate 	{'h','/'}, {'i','.'}, {'i','j'}, {'l','.'},
838*7c478bd9Sstevel@tonic-gate 	{'l','/'}, {0xf8,0},  {'o','e'}, {0xdf,0},
839*7c478bd9Sstevel@tonic-gate 	{0xfe,0},  {0xbb,0},  {0xbf,0},  {'-','-'}
840*7c478bd9Sstevel@tonic-gate #else
841*7c478bd9Sstevel@tonic-gate 	{'-','M'}, {'1','S'}, {'R','g'}, {'C','o'},
842*7c478bd9Sstevel@tonic-gate 	{'T','M'}, {'M','8'}, {'N','O'}, {'B','B'},
843*7c478bd9Sstevel@tonic-gate 	{0,0},     {0,0},     {0,0},     {0,0},
844*7c478bd9Sstevel@tonic-gate 	{'1','8'}, {'3','8'}, {'5','8'}, {'7','8'},
845*7c478bd9Sstevel@tonic-gate 	{'O','m'}, {'A','E'}, {'D','/'}, {'-','a'},
846*7c478bd9Sstevel@tonic-gate 	{'H','/'}, {0,0},     {'I','J'}, {'L','.'},
847*7c478bd9Sstevel@tonic-gate 	{'L','/'}, {'O','/'}, {'O','E'}, {'-','o'},
848*7c478bd9Sstevel@tonic-gate 	{'T','H'}, {'T','/'}, {'N','G'}, {'\'','n'},
849*7c478bd9Sstevel@tonic-gate 	{'k','k'}, {'a','e'}, {'d','/'}, {'d','-'},
850*7c478bd9Sstevel@tonic-gate 	{'h','/'}, {'i','.'}, {'i','j'}, {'l','.'},
851*7c478bd9Sstevel@tonic-gate 	{'l','/'}, {'o','/'}, {'o','e'}, {'s','s'},
852*7c478bd9Sstevel@tonic-gate 	{'t','h'}, {'t','-'}, {'n','g'}, {'-','-'}
853*7c478bd9Sstevel@tonic-gate #endif
854*7c478bd9Sstevel@tonic-gate };
855*7c478bd9Sstevel@tonic-gate 
856*7c478bd9Sstevel@tonic-gate /*
857*7c478bd9Sstevel@tonic-gate --- ISO 8859-n characters <0xA0 .. 0xFF> -------------------
858*7c478bd9Sstevel@tonic-gate */
859*7c478bd9Sstevel@tonic-gate #if (ISO_8859 == 1)
860*7c478bd9Sstevel@tonic-gate static Couple trans_iso8859_t61[96] = {
861*7c478bd9Sstevel@tonic-gate 	{0xa0,0},     {0xa1,0},     {0xa2,0},     {0xa3,0},
862*7c478bd9Sstevel@tonic-gate 	{0xa8,0},     {0xa5,0},     {0xd7,0},     {0xa7,0},
863*7c478bd9Sstevel@tonic-gate 	{0xc8,ALONE}, {0xd3,0},     {0xe3,0},     {0xab,0},
864*7c478bd9Sstevel@tonic-gate 	{0xd6,0},     {0xff,0},     {0xd2,0},     {0xc5,ALONE},
865*7c478bd9Sstevel@tonic-gate 	{0xb0,0},     {0xb1,0},     {0xb2,0},     {0xb3,0},
866*7c478bd9Sstevel@tonic-gate 	{0xc2,ALONE}, {0xb5,0},     {0xb6,0},     {0xb7,0},
867*7c478bd9Sstevel@tonic-gate 	{0xcb,ALONE}, {0xd1,0},     {0xeb,0},     {0xbb,0},
868*7c478bd9Sstevel@tonic-gate 	{0xbc,0},     {0xbd,0},     {0xbe,0},     {0xbf,0},
869*7c478bd9Sstevel@tonic-gate 	{0xc1,'A'},   {0xc2,'A'},   {0xc3,'A'},   {0xc4,'A'},
870*7c478bd9Sstevel@tonic-gate 	{0xc8,'A'},   {0xca,'A'},   {0xe1,0},     {0xcb,'C'},
871*7c478bd9Sstevel@tonic-gate 	{0xc1,'E'},   {0xc2,'E'},   {0xc3,'E'},   {0xc8,'E'},
872*7c478bd9Sstevel@tonic-gate 	{0xc1,'I'},   {0xc2,'I'},   {0xc3,'I'},   {0xc8,'I'},
873*7c478bd9Sstevel@tonic-gate 	{0xe2,0},     {0xc4,'N'},   {0xc1,'O'},   {0xc2,'O'},
874*7c478bd9Sstevel@tonic-gate 	{0xc3,'O'},   {0xc4,'O'},   {0xc8,'O'},   {0xb4,0},
875*7c478bd9Sstevel@tonic-gate 	{0xe9,0},     {0xc1,'U'},   {0xc2,'U'},   {0xc3,'U'},
876*7c478bd9Sstevel@tonic-gate 	{0xc8,'U'},   {0xc2,'Y'},   {0xec,0},     {0xfb,0},
877*7c478bd9Sstevel@tonic-gate 	{0xc1,'a'},   {0xc2,'a'},   {0xc3,'a'},   {0xc4,'a'},
878*7c478bd9Sstevel@tonic-gate 	{0xc8,'a'},   {0xca,'a'},   {0xf1,0},     {0xcb,'c'},
879*7c478bd9Sstevel@tonic-gate 	{0xc1,'e'},   {0xc2,'e'},   {0xc3,'e'},   {0xc8,'e'},
880*7c478bd9Sstevel@tonic-gate 	{0xc1,'i'},   {0xc2,'i'},   {0xc3,'i'},   {0xc8,'i'},
881*7c478bd9Sstevel@tonic-gate 	{0xf3,0},     {0xc4,'n'},   {0xc1,'o'},   {0xc2,'o'},
882*7c478bd9Sstevel@tonic-gate 	{0xc3,'o'},   {0xc4,'o'},   {0xc8,'o'},   {0xb8,0},
883*7c478bd9Sstevel@tonic-gate 	{0xf9,0},     {0xc1,'u'},   {0xc2,'u'},   {0xc3,'u'},
884*7c478bd9Sstevel@tonic-gate 	{0xc8,'u'},   {0xc2,'y'},   {0xfc,0},     {0xc8,'y'}
885*7c478bd9Sstevel@tonic-gate };
886*7c478bd9Sstevel@tonic-gate #elif (ISO_8859 == 2)
887*7c478bd9Sstevel@tonic-gate static Couple trans_iso8859_t61[96] = {
888*7c478bd9Sstevel@tonic-gate 	{0xa0,0},     {0xce,'A'},   {0xc6,ALONE}, {0xe8,0},
889*7c478bd9Sstevel@tonic-gate 	{0xa8,0},     {0xcf,'L'},   {0xc2,'S'},   {0xa7,0},
890*7c478bd9Sstevel@tonic-gate 	{0xc8,ALONE}, {0xcf,'S'},   {0xcb,'S'},   {0xcf,'T'},
891*7c478bd9Sstevel@tonic-gate 	{0xc2,'Z'},   {0xff,0},     {0xcf,'Z'},   {0xc7,'Z'},
892*7c478bd9Sstevel@tonic-gate 	{0xb0,0},     {0xce,'a'},   {0xce,ALONE}, {0xf8,0},
893*7c478bd9Sstevel@tonic-gate 	{0xc2,ALONE}, {0xcf,'l'},   {0xc2,'s'},   {0xcf,ALONE},
894*7c478bd9Sstevel@tonic-gate 	{0xcb,ALONE}, {0xcf,'s'},   {0xcb,'s'},   {0xcf,'t'},
895*7c478bd9Sstevel@tonic-gate 	{0xc2,'z'},   {0xcd,ALONE}, {0xcf,'z'},   {0xc7,'z'},
896*7c478bd9Sstevel@tonic-gate 	{0xc2,'R'},   {0xc2,'A'},   {0xc3,'A'},   {0xc6,'A'},
897*7c478bd9Sstevel@tonic-gate 	{0xc8,'A'},   {0xc2,'L'},   {0xc2,'C'},   {0xcb,'C'},
898*7c478bd9Sstevel@tonic-gate 	{0xcf,'C'},   {0xc2,'E'},   {0xce,'E'},   {0xc8,'E'},
899*7c478bd9Sstevel@tonic-gate 	{0xcf,'E'},   {0xc2,'I'},   {0xc3,'I'},   {0xcf,'D'},
900*7c478bd9Sstevel@tonic-gate 	{0xe2,0},     {0xc2,'N'},   {0xcf,'N'},   {0xc2,'O'},
901*7c478bd9Sstevel@tonic-gate 	{0xc3,'O'},   {0xcd,'O'},   {0xc8,'O'},   {0xb4,0},
902*7c478bd9Sstevel@tonic-gate 	{0xcf,'R'},   {0xca,'U'},   {0xc2,'U'},   {0xcd,'U'},
903*7c478bd9Sstevel@tonic-gate 	{0xc8,'U'},   {0xc2,'Y'},   {0xcb,'T'},   {0xfb,0},
904*7c478bd9Sstevel@tonic-gate 	{0xc2,'r'},   {0xc2,'a'},   {0xc3,'a'},   {0xc6,'a'},
905*7c478bd9Sstevel@tonic-gate 	{0xc8,'a'},   {0xc2,'l'},   {0xc2,'c'},   {0xcb,'c'},
906*7c478bd9Sstevel@tonic-gate 	{0xcf,'c'},   {0xc2,'e'},   {0xce,'e'},   {0xc8,'e'},
907*7c478bd9Sstevel@tonic-gate 	{0xcf,'e'},   {0xc2,'i'},   {0xc3,'i'},   {0xcf,'d'},
908*7c478bd9Sstevel@tonic-gate 	{0xf2,0},     {0xc2,'n'},   {0xcf,'n'},   {0xc2,'o'},
909*7c478bd9Sstevel@tonic-gate 	{0xc3,'o'},   {0xcd,'o'},   {0xc8,'o'},   {0xb8,0},
910*7c478bd9Sstevel@tonic-gate 	{0xcf,'r'},   {0xca,'u'},   {0xc2,'u'},   {0xcd,'u'},
911*7c478bd9Sstevel@tonic-gate 	{0xc8,'u'},   {0xc2,'y'},   {0xcb,'t'},   {0xc7,ALONE}
912*7c478bd9Sstevel@tonic-gate };
913*7c478bd9Sstevel@tonic-gate #elif (ISO_8859 == 3)
914*7c478bd9Sstevel@tonic-gate static Couple trans_iso8859_t61[96] = {
915*7c478bd9Sstevel@tonic-gate 	{0xa0,0},     {0xe4,0},     {0xc6,ALONE}, {0xa3,0},
916*7c478bd9Sstevel@tonic-gate 	{0xa8,0},     {0,0},        {0xc3,'H'},   {0xa7,0},
917*7c478bd9Sstevel@tonic-gate 	{0xc8,ALONE}, {0xc7,'I'},   {0xcb,'S'},   {0xc6,'G'},
918*7c478bd9Sstevel@tonic-gate 	{0xc3,'J'},   {0xff,0},     {0,0},        {0xc7,'Z'},
919*7c478bd9Sstevel@tonic-gate 	{0xb0,0},     {0xf4,0},     {0xb2,0},     {0xb3,0},
920*7c478bd9Sstevel@tonic-gate 	{0xc2,ALONE}, {0xb5,0},     {0xc3,'h'},   {0xb7,0},
921*7c478bd9Sstevel@tonic-gate 	{0xcb,ALONE}, {0xf5,0},     {0xcb,'s'},   {0xc6,'g'},
922*7c478bd9Sstevel@tonic-gate 	{0xc3,'j'},   {0xbd,0},     {0,0},        {0xc7,'z'},
923*7c478bd9Sstevel@tonic-gate 	{0xc1,'A'},   {0xc2,'A'},   {0xc3,'A'},   {0,0},
924*7c478bd9Sstevel@tonic-gate 	{0xc8,'A'},   {0xc7,'C'},   {0xc3,'C'},   {0xcb,'C'},
925*7c478bd9Sstevel@tonic-gate 	{0xc1,'E'},   {0xc2,'E'},   {0xc3,'E'},   {0xc8,'E'},
926*7c478bd9Sstevel@tonic-gate 	{0xc1,'I'},   {0xc2,'I'},   {0xc3,'I'},   {0xc8,'I'},
927*7c478bd9Sstevel@tonic-gate 	{0,0},        {0xc4,'N'},   {0xc1,'O'},   {0xc2,'O'},
928*7c478bd9Sstevel@tonic-gate 	{0xc3,'O'},   {0xc7,'G'},   {0xc8,'O'},   {0xb4,0},
929*7c478bd9Sstevel@tonic-gate 	{0xc3,'G'},   {0xc1,'U'},   {0xc2,'U'},   {0xc3,'U'},
930*7c478bd9Sstevel@tonic-gate 	{0xc8,'U'},   {0xc6,'U'},   {0xc3,'S'},   {0xfb,0},
931*7c478bd9Sstevel@tonic-gate 	{0xc1,'a'},   {0xc2,'a'},   {0xc3,'a'},   {0,0},
932*7c478bd9Sstevel@tonic-gate 	{0xc8,'a'},   {0xc7,'c'},   {0xc3,'c'},   {0xcb,'c'},
933*7c478bd9Sstevel@tonic-gate 	{0xc1,'e'},   {0xc2,'e'},   {0xc3,'e'},   {0xc8,'e'},
934*7c478bd9Sstevel@tonic-gate 	{0xc1,'i'},   {0xc2,'i'},   {0xc3,'i'},   {0xc8,'i'},
935*7c478bd9Sstevel@tonic-gate 	{0,0},        {0xc4,'n'},   {0xc1,'o'},   {0xc2,'o'},
936*7c478bd9Sstevel@tonic-gate 	{0xc3,'o'},   {0xc7,'g'},   {0xc8,'o'},   {0xb8,0},
937*7c478bd9Sstevel@tonic-gate 	{0xc3,'g'},   {0xc1,'u'},   {0xc2,'u'},   {0xc3,'u'},
938*7c478bd9Sstevel@tonic-gate 	{0xc8,'u'},   {0xc6,'u'},   {0xc3,'s'},   {0xc7,ALONE}
939*7c478bd9Sstevel@tonic-gate };
940*7c478bd9Sstevel@tonic-gate #elif (ISO_8859 == 4)
941*7c478bd9Sstevel@tonic-gate static Couple trans_iso8859_t61[96] = {
942*7c478bd9Sstevel@tonic-gate 	{0xa0,0},     {0xce,'A'},   {0xf0,0},     {0xcb,'R'},
943*7c478bd9Sstevel@tonic-gate 	{0xa8,0},     {0xc4,'I'},   {0xcb,'L'},   {0xa7,0},
944*7c478bd9Sstevel@tonic-gate 	{0xc8,ALONE}, {0xcf,'S'},   {0xc5,'E'},   {0xcb,'G'},
945*7c478bd9Sstevel@tonic-gate 	{0xed,0},     {0xff,0},     {0xcf,'Z'},   {0xc5,ALONE},
946*7c478bd9Sstevel@tonic-gate 	{0xb0,0},     {0xce,'a'},   {0xce,ALONE}, {0xcb,'r'},
947*7c478bd9Sstevel@tonic-gate 	{0xc2,ALONE}, {0xc4,'i'},   {0xcb,'l'},   {0xcf,ALONE},
948*7c478bd9Sstevel@tonic-gate 	{0xcb,ALONE}, {0xcf,'s'},   {0xc5,'e'},   {0xcb,'g'},
949*7c478bd9Sstevel@tonic-gate 	{0xfd,0},     {0xee,0},     {0xcf,'z'},   {0xfe,0},
950*7c478bd9Sstevel@tonic-gate 	{0xc5,'A'},   {0xc2,'A'},   {0xc3,'A'},   {0xc4,'A'},
951*7c478bd9Sstevel@tonic-gate 	{0xc8,'A'},   {0xca,'A'},   {0xe1,0},     {0xce,'I'},
952*7c478bd9Sstevel@tonic-gate 	{0xcf,'C'},   {0xc2,'E'},   {0xce,'E'},   {0xc8,'E'},
953*7c478bd9Sstevel@tonic-gate 	{0xc7,'E'},   {0xc2,'I'},   {0xc3,'I'},   {0xc5,'I'},
954*7c478bd9Sstevel@tonic-gate 	{0xe2,0},     {0xcb,'N'},   {0xc5,'O'},   {0xcb,'K'},
955*7c478bd9Sstevel@tonic-gate 	{0xc3,'O'},   {0xc4,'O'},   {0xc8,'O'},   {0xb4,0},
956*7c478bd9Sstevel@tonic-gate 	{0xe9,0},     {0xce,'U'},   {0xc2,'U'},   {0xc3,'U'},
957*7c478bd9Sstevel@tonic-gate 	{0xc8,'U'},   {0xc4,'U'},   {0xc5,'U'},   {0xfb,0},
958*7c478bd9Sstevel@tonic-gate 	{0xc5,'a'},   {0xc2,'a'},   {0xc3,'a'},   {0xc4,'a'},
959*7c478bd9Sstevel@tonic-gate 	{0xc8,'a'},   {0xca,'a'},   {0xf1,0},     {0xce,'i'},
960*7c478bd9Sstevel@tonic-gate 	{0xcf,'c'},   {0xc2,'e'},   {0xce,'e'},   {0xc8,'e'},
961*7c478bd9Sstevel@tonic-gate 	{0xc7,'e'},   {0xc2,'i'},   {0xc3,'i'},   {0xc5,'i'},
962*7c478bd9Sstevel@tonic-gate 	{0xf2,0},     {0xcb,'n'},   {0xc5,'o'},   {0xcb,'k'},
963*7c478bd9Sstevel@tonic-gate 	{0xc3,'o'},   {0xc4,'o'},   {0xc8,'o'},   {0xb8,0},
964*7c478bd9Sstevel@tonic-gate 	{0xf9,0},     {0xce,'u'},   {0xc2,'u'},   {0xc3,'u'},
965*7c478bd9Sstevel@tonic-gate 	{0xc8,'u'},   {0xc4,'u'},   {0xc5,'u'},   {0xc7,ALONE}
966*7c478bd9Sstevel@tonic-gate };
967*7c478bd9Sstevel@tonic-gate #elif (ISO_8859 == 9)
968*7c478bd9Sstevel@tonic-gate static Couple trans_iso8859_t61[96] = {
969*7c478bd9Sstevel@tonic-gate 	{0xa0,0},     {0xa1,0},     {0xa2,0},     {0xa3,0},
970*7c478bd9Sstevel@tonic-gate 	{0xa8,0},     {0xa5,0},     {0xd7,0},     {0xa7,0},
971*7c478bd9Sstevel@tonic-gate 	{0xc8,ALONE}, {0xd3,0},     {0xe3,0},     {0xab,0},
972*7c478bd9Sstevel@tonic-gate 	{0xd6,0},     {0xff,0},     {0xd2,0},     {0xc5,ALONE},
973*7c478bd9Sstevel@tonic-gate 	{0xb0,0},     {0xb1,0},     {0xb2,0},     {0xb3,0},
974*7c478bd9Sstevel@tonic-gate 	{0xc2,ALONE}, {0xb5,0},     {0xb6,0},     {0xb7,0},
975*7c478bd9Sstevel@tonic-gate 	{0xcb,ALONE}, {0xd1,0},     {0xeb,0},     {0xbb,0},
976*7c478bd9Sstevel@tonic-gate 	{0xbc,0},     {0xbd,0},     {0xbe,0},     {0xbf,0},
977*7c478bd9Sstevel@tonic-gate 	{0xc1,'A'},   {0xc2,'A'},   {0xc3,'A'},   {0xc4,'A'},
978*7c478bd9Sstevel@tonic-gate 	{0xc8,'A'},   {0xca,'A'},   {0xe1,0},     {0xcb,'C'},
979*7c478bd9Sstevel@tonic-gate 	{0xc1,'E'},   {0xc2,'E'},   {0xc3,'E'},   {0xc8,'E'},
980*7c478bd9Sstevel@tonic-gate 	{0xc1,'I'},   {0xc2,'I'},   {0xc3,'I'},   {0xc8,'I'},
981*7c478bd9Sstevel@tonic-gate 	{0xc6,'G'},   {0xc4,'N'},   {0xc1,'O'},   {0xc2,'O'},
982*7c478bd9Sstevel@tonic-gate 	{0xc3,'O'},   {0xc4,'O'},   {0xc8,'O'},   {0xb4,0},
983*7c478bd9Sstevel@tonic-gate 	{0xe9,0},     {0xc1,'U'},   {0xc2,'U'},   {0xc3,'U'},
984*7c478bd9Sstevel@tonic-gate 	{0xc8,'U'},   {0xc7,'I'},   {0xcb,'S'},   {0xfb,0},
985*7c478bd9Sstevel@tonic-gate 	{0xc1,'a'},   {0xc2,'a'},   {0xc3,'a'},   {0xc4,'a'},
986*7c478bd9Sstevel@tonic-gate 	{0xc8,'a'},   {0xca,'a'},   {0xf1,0},     {0xcb,'c'},
987*7c478bd9Sstevel@tonic-gate 	{0xc1,'e'},   {0xc2,'e'},   {0xce,'e'},   {0xc8,'e'},
988*7c478bd9Sstevel@tonic-gate 	{0xc7,'e'},   {0xc2,'i'},   {0xc3,'i'},   {0xc5,'i'},
989*7c478bd9Sstevel@tonic-gate 	{0xc6,'g'},   {0xc4,'n'},   {0xc1,'o'},   {0xc2,'o'},
990*7c478bd9Sstevel@tonic-gate 	{0xc3,'o'},   {0xc4,'o'},   {0xc8,'o'},   {0xb8,0},
991*7c478bd9Sstevel@tonic-gate 	{0xf9,0},     {0xc1,'u'},   {0xc2,'u'},   {0xc3,'u'},
992*7c478bd9Sstevel@tonic-gate 	{0xc8,'u'},   {0xf5,0},     {0xcb,'s'},   {0xc8,'y'}
993*7c478bd9Sstevel@tonic-gate };
994*7c478bd9Sstevel@tonic-gate #elif (ISO_8859 == 10)
995*7c478bd9Sstevel@tonic-gate static Couple trans_iso8859_t61[96] = {
996*7c478bd9Sstevel@tonic-gate 	{0xa0,0},     {0xce,'A'},   {0xc5,'E'},   {0xcb,'G'},
997*7c478bd9Sstevel@tonic-gate 	{0xc5,'I'},   {0xc4,'I'},   {0xcb,'K'},   {0xa7,0},
998*7c478bd9Sstevel@tonic-gate 	{0xcb,'L'},   {0xe2,0},     {0xcf,'S'},   {0xed,0},
999*7c478bd9Sstevel@tonic-gate 	{0xcf,'Z'},   {0xff,0},     {0xc5,'U'},   {0xee,0},
1000*7c478bd9Sstevel@tonic-gate 	{0xb0,0},     {0xce,'a'},   {0xc5,'e'},   {0xcb,'g'},
1001*7c478bd9Sstevel@tonic-gate 	{0xc5,'i'},   {0xc4,'i'},   {0xcb,'k'},   {0xb7,0},
1002*7c478bd9Sstevel@tonic-gate 	{0xcb,'l'},   {0xf2,0},     {0xcf,'s'},   {0xfd,0},
1003*7c478bd9Sstevel@tonic-gate 	{0xcf,'z'},   {0xd0,0},     {0xc5,'u'},   {0xfe,0},
1004*7c478bd9Sstevel@tonic-gate 	{0xc5,'A'},   {0xc2,'A'},   {0xc3,'A'},   {0xc4,'A'},
1005*7c478bd9Sstevel@tonic-gate 	{0xc8,'A'},   {0xca,'A'},   {0xe1,0},     {0xce,'I'},
1006*7c478bd9Sstevel@tonic-gate 	{0xcf,'C'},   {0xc2,'E'},   {0xce,'E'},   {0xc8,'E'},
1007*7c478bd9Sstevel@tonic-gate 	{0xc7,'E'},   {0xc2,'I'},   {0xc3,'I'},   {0xc8,'I'},
1008*7c478bd9Sstevel@tonic-gate 	{0,0},        {0xcb,'N'},   {0xc5,'O'},   {0xc2,'O'},
1009*7c478bd9Sstevel@tonic-gate 	{0xc3,'O'},   {0xc4,'O'},   {0xc8,'O'},   {0xc4,'U'},
1010*7c478bd9Sstevel@tonic-gate 	{0xe9,0},     {0xce,'U'},   {0xc2,'U'},   {0xc3,'U'},
1011*7c478bd9Sstevel@tonic-gate 	{0xc8,'U'},   {0xc2,'Y'},   {0xec,0},     {0xfb,0},
1012*7c478bd9Sstevel@tonic-gate 	{0xc5,'a'},   {0xc2,'a'},   {0xc3,'a'},   {0xc4,'a'},
1013*7c478bd9Sstevel@tonic-gate 	{0xc8,'a'},   {0xca,'a'},   {0xf1,0},     {0xce,'i'},
1014*7c478bd9Sstevel@tonic-gate 	{0xcf,'c'},   {0xc2,'e'},   {0xce,'e'},   {0xc8,'e'},
1015*7c478bd9Sstevel@tonic-gate 	{0xc7,'e'},   {0xc2,'i'},   {0xc3,'i'},   {0xc8,'i'},
1016*7c478bd9Sstevel@tonic-gate 	{0xf3,0},     {0xcb,'n'},   {0xc5,'o'},   {0xc2,'o'},
1017*7c478bd9Sstevel@tonic-gate 	{0xc3,'o'},   {0xc4,'o'},   {0xc8,'o'},   {0xc4,'u'},
1018*7c478bd9Sstevel@tonic-gate 	{0xf9,0},     {0xce,'u'},   {0xc2,'u'},   {0xc3,'u'},
1019*7c478bd9Sstevel@tonic-gate 	{0xc8,'u'},   {0xc2,'y'},   {0xfc,0},     {0xf0,0}
1020*7c478bd9Sstevel@tonic-gate };
1021*7c478bd9Sstevel@tonic-gate #endif
1022*7c478bd9Sstevel@tonic-gate 
1023*7c478bd9Sstevel@tonic-gate 
1024*7c478bd9Sstevel@tonic-gate static Byte *
1025*7c478bd9Sstevel@tonic-gate c_to_hh( Byte *o, Byte c )
1026*7c478bd9Sstevel@tonic-gate {
1027*7c478bd9Sstevel@tonic-gate   Byte n;
1028*7c478bd9Sstevel@tonic-gate 
1029*7c478bd9Sstevel@tonic-gate   *o++ = '{'; *o++ = 'x';
1030*7c478bd9Sstevel@tonic-gate   n = c >> 4;
1031*7c478bd9Sstevel@tonic-gate   *o++ = ((n < 0xA) ? '0' : 'A' - 0xA) + n;
1032*7c478bd9Sstevel@tonic-gate   n = c & 0x0F;
1033*7c478bd9Sstevel@tonic-gate   *o++ = ((n < 0xA) ? '0' : 'A' - 0xA) + n;
1034*7c478bd9Sstevel@tonic-gate   *o++ = '}';
1035*7c478bd9Sstevel@tonic-gate   return o;
1036*7c478bd9Sstevel@tonic-gate }
1037*7c478bd9Sstevel@tonic-gate 
1038*7c478bd9Sstevel@tonic-gate 
1039*7c478bd9Sstevel@tonic-gate static Byte *
1040*7c478bd9Sstevel@tonic-gate c_to_cc( Byte *o, Couple *cc, Byte c )
1041*7c478bd9Sstevel@tonic-gate {
1042*7c478bd9Sstevel@tonic-gate   if ( (*cc).a != 0 ) {
1043*7c478bd9Sstevel@tonic-gate     if ( (*cc).b == 0 )
1044*7c478bd9Sstevel@tonic-gate       *o++ = (*cc).a;
1045*7c478bd9Sstevel@tonic-gate     else {
1046*7c478bd9Sstevel@tonic-gate       *o++ = '{';
1047*7c478bd9Sstevel@tonic-gate       *o++ = (*cc).a;
1048*7c478bd9Sstevel@tonic-gate       *o++ = (*cc).b;
1049*7c478bd9Sstevel@tonic-gate       *o++ = '}';
1050*7c478bd9Sstevel@tonic-gate     }
1051*7c478bd9Sstevel@tonic-gate     return o;
1052*7c478bd9Sstevel@tonic-gate   }
1053*7c478bd9Sstevel@tonic-gate   else
1054*7c478bd9Sstevel@tonic-gate     return c_to_hh( o, c );
1055*7c478bd9Sstevel@tonic-gate }
1056*7c478bd9Sstevel@tonic-gate 
1057*7c478bd9Sstevel@tonic-gate /* --- routine to convert from T.61 to ISO 8859-n --- */
1058*7c478bd9Sstevel@tonic-gate 
1059*7c478bd9Sstevel@tonic-gate int
1060*7c478bd9Sstevel@tonic-gate ldap_t61_to_8859( char **bufp, unsigned long *buflenp, int free_input )
1061*7c478bd9Sstevel@tonic-gate {
1062*7c478bd9Sstevel@tonic-gate   Byte		*s, *oo, *o;
1063*7c478bd9Sstevel@tonic-gate   unsigned int  n;
1064*7c478bd9Sstevel@tonic-gate   int           c;
1065*7c478bd9Sstevel@tonic-gate   unsigned long len;
1066*7c478bd9Sstevel@tonic-gate   Couple        *cc;
1067*7c478bd9Sstevel@tonic-gate 
1068*7c478bd9Sstevel@tonic-gate   LDAPDebug( LDAP_DEBUG_TRACE, "ldap_t61_to_8859 input length: %ld\n",
1069*7c478bd9Sstevel@tonic-gate 	*buflenp, 0, 0 );
1070*7c478bd9Sstevel@tonic-gate 
1071*7c478bd9Sstevel@tonic-gate   len = *buflenp;
1072*7c478bd9Sstevel@tonic-gate   s = (Byte *) *bufp;
1073*7c478bd9Sstevel@tonic-gate 
1074*7c478bd9Sstevel@tonic-gate   if ( (o = oo = (Byte *)NSLDAPI_MALLOC( 2 * len + 64 )) == NULL ) {
1075*7c478bd9Sstevel@tonic-gate         return( 1 );
1076*7c478bd9Sstevel@tonic-gate   }
1077*7c478bd9Sstevel@tonic-gate 
1078*7c478bd9Sstevel@tonic-gate   while ( (char *)s - *(char **)bufp < len ) {
1079*7c478bd9Sstevel@tonic-gate     switch ( *s >> 4 ) {
1080*7c478bd9Sstevel@tonic-gate 
1081*7c478bd9Sstevel@tonic-gate     case 0xA: case 0xB:
1082*7c478bd9Sstevel@tonic-gate       o = c_to_cc( o, &trans_t61a_iso8859[ *s - 0xA0 ], *s );
1083*7c478bd9Sstevel@tonic-gate       s++;
1084*7c478bd9Sstevel@tonic-gate       break;
1085*7c478bd9Sstevel@tonic-gate 
1086*7c478bd9Sstevel@tonic-gate     case 0xD: case 0xE: case 0xF:
1087*7c478bd9Sstevel@tonic-gate       o = c_to_cc( o, &trans_t61b_iso8859[ *s - 0xD0 ], *s );
1088*7c478bd9Sstevel@tonic-gate       s++;
1089*7c478bd9Sstevel@tonic-gate       break;
1090*7c478bd9Sstevel@tonic-gate 
1091*7c478bd9Sstevel@tonic-gate     case 0xC:
1092*7c478bd9Sstevel@tonic-gate       if ( (*s == 0xC0) || (*s == 0xC9) || (*s == 0xCC) ) {
1093*7c478bd9Sstevel@tonic-gate         o = c_to_hh( o, *s++ );
1094*7c478bd9Sstevel@tonic-gate         break;
1095*7c478bd9Sstevel@tonic-gate       }
1096*7c478bd9Sstevel@tonic-gate 
1097*7c478bd9Sstevel@tonic-gate       n = (*s++) - 0xC0;
1098*7c478bd9Sstevel@tonic-gate       switch ( *s ) {
1099*7c478bd9Sstevel@tonic-gate 
1100*7c478bd9Sstevel@tonic-gate       case 'A':  c = letter_w_diacritic[n][0]; break;
1101*7c478bd9Sstevel@tonic-gate       case 'C':  c = letter_w_diacritic[n][1]; break;
1102*7c478bd9Sstevel@tonic-gate       case 'D':  c = letter_w_diacritic[n][2]; break;
1103*7c478bd9Sstevel@tonic-gate       case 'E':  c = letter_w_diacritic[n][3]; break;
1104*7c478bd9Sstevel@tonic-gate       case 'G':  c = letter_w_diacritic[n][4]; break;
1105*7c478bd9Sstevel@tonic-gate       case 'H':  c = letter_w_diacritic[n][5]; break;
1106*7c478bd9Sstevel@tonic-gate       case 'I':  c = letter_w_diacritic[n][6]; break;
1107*7c478bd9Sstevel@tonic-gate       case 'J':  c = letter_w_diacritic[n][7]; break;
1108*7c478bd9Sstevel@tonic-gate       case 'K':  c = letter_w_diacritic[n][8]; break;
1109*7c478bd9Sstevel@tonic-gate       case 'L':  c = letter_w_diacritic[n][9]; break;
1110*7c478bd9Sstevel@tonic-gate       case 'N':  c = letter_w_diacritic[n][10]; break;
1111*7c478bd9Sstevel@tonic-gate       case 'O':  c = letter_w_diacritic[n][11]; break;
1112*7c478bd9Sstevel@tonic-gate       case 'R':  c = letter_w_diacritic[n][12]; break;
1113*7c478bd9Sstevel@tonic-gate       case 'S':  c = letter_w_diacritic[n][13]; break;
1114*7c478bd9Sstevel@tonic-gate       case 'T':  c = letter_w_diacritic[n][14]; break;
1115*7c478bd9Sstevel@tonic-gate       case 'U':  c = letter_w_diacritic[n][15]; break;
1116*7c478bd9Sstevel@tonic-gate       case 'W':  c = letter_w_diacritic[n][16]; break;
1117*7c478bd9Sstevel@tonic-gate       case 'Y':  c = letter_w_diacritic[n][17]; break;
1118*7c478bd9Sstevel@tonic-gate       case 'Z':  c = letter_w_diacritic[n][18]; break;
1119*7c478bd9Sstevel@tonic-gate 
1120*7c478bd9Sstevel@tonic-gate       case 'a':  c = letter_w_diacritic[n][19]; break;
1121*7c478bd9Sstevel@tonic-gate       case 'c':  c = letter_w_diacritic[n][20]; break;
1122*7c478bd9Sstevel@tonic-gate       case 'd':  c = letter_w_diacritic[n][21]; break;
1123*7c478bd9Sstevel@tonic-gate       case 'e':  c = letter_w_diacritic[n][22]; break;
1124*7c478bd9Sstevel@tonic-gate       case 'g':  c = letter_w_diacritic[n][23]; break;
1125*7c478bd9Sstevel@tonic-gate       case 'h':  c = letter_w_diacritic[n][24]; break;
1126*7c478bd9Sstevel@tonic-gate       case 'i':  c = letter_w_diacritic[n][25]; break;
1127*7c478bd9Sstevel@tonic-gate       case 'j':  c = letter_w_diacritic[n][26]; break;
1128*7c478bd9Sstevel@tonic-gate       case 'k':  c = letter_w_diacritic[n][27]; break;
1129*7c478bd9Sstevel@tonic-gate       case 'l':  c = letter_w_diacritic[n][28]; break;
1130*7c478bd9Sstevel@tonic-gate       case 'n':  c = letter_w_diacritic[n][29]; break;
1131*7c478bd9Sstevel@tonic-gate       case 'o':  c = letter_w_diacritic[n][30]; break;
1132*7c478bd9Sstevel@tonic-gate       case 'r':  c = letter_w_diacritic[n][31]; break;
1133*7c478bd9Sstevel@tonic-gate       case 's':  c = letter_w_diacritic[n][32]; break;
1134*7c478bd9Sstevel@tonic-gate       case 't':  c = letter_w_diacritic[n][33]; break;
1135*7c478bd9Sstevel@tonic-gate       case 'u':  c = letter_w_diacritic[n][34]; break;
1136*7c478bd9Sstevel@tonic-gate       case 'w':  c = letter_w_diacritic[n][35]; break;
1137*7c478bd9Sstevel@tonic-gate       case 'y':  c = letter_w_diacritic[n][36]; break;
1138*7c478bd9Sstevel@tonic-gate       case 'z':  c = letter_w_diacritic[n][37]; break;
1139*7c478bd9Sstevel@tonic-gate 
1140*7c478bd9Sstevel@tonic-gate       case ALONE:  c = (( !diacritic[n].b ) ? diacritic[n].a : -1);
1141*7c478bd9Sstevel@tonic-gate                    break;
1142*7c478bd9Sstevel@tonic-gate 
1143*7c478bd9Sstevel@tonic-gate       default:   c = 0;
1144*7c478bd9Sstevel@tonic-gate       }
1145*7c478bd9Sstevel@tonic-gate 
1146*7c478bd9Sstevel@tonic-gate       if ( c > 0 ) {
1147*7c478bd9Sstevel@tonic-gate         *o++ = c;  s++;
1148*7c478bd9Sstevel@tonic-gate       } else {
1149*7c478bd9Sstevel@tonic-gate         *o++ = '{';
1150*7c478bd9Sstevel@tonic-gate         if ( c == -1 ) {
1151*7c478bd9Sstevel@tonic-gate           *o++ = ( ( *s == ALONE ) ? ' ' : *s );
1152*7c478bd9Sstevel@tonic-gate           s++;
1153*7c478bd9Sstevel@tonic-gate         } else {
1154*7c478bd9Sstevel@tonic-gate           *o++ = '"';
1155*7c478bd9Sstevel@tonic-gate         }
1156*7c478bd9Sstevel@tonic-gate         *o++ = diacritic[n].a;
1157*7c478bd9Sstevel@tonic-gate         *o++ = '}';
1158*7c478bd9Sstevel@tonic-gate       }
1159*7c478bd9Sstevel@tonic-gate       break;
1160*7c478bd9Sstevel@tonic-gate 
1161*7c478bd9Sstevel@tonic-gate #if (ISO_8859 == 0)
1162*7c478bd9Sstevel@tonic-gate     case 0x8: case 0x9:
1163*7c478bd9Sstevel@tonic-gate       *o++ = 0x1B; /* <ESC> */
1164*7c478bd9Sstevel@tonic-gate       *o++ = *s++ - 0x40;
1165*7c478bd9Sstevel@tonic-gate       break;
1166*7c478bd9Sstevel@tonic-gate #endif
1167*7c478bd9Sstevel@tonic-gate 
1168*7c478bd9Sstevel@tonic-gate       default:
1169*7c478bd9Sstevel@tonic-gate         *o++ = *s++;
1170*7c478bd9Sstevel@tonic-gate     }
1171*7c478bd9Sstevel@tonic-gate   }
1172*7c478bd9Sstevel@tonic-gate 
1173*7c478bd9Sstevel@tonic-gate   len = o - oo;
1174*7c478bd9Sstevel@tonic-gate   o = oo;
1175*7c478bd9Sstevel@tonic-gate 
1176*7c478bd9Sstevel@tonic-gate   if ( (oo = (Byte *)NSLDAPI_REALLOC( o, len )) == NULL ) {
1177*7c478bd9Sstevel@tonic-gate     NSLDAPI_FREE( o );
1178*7c478bd9Sstevel@tonic-gate     return( 1 );
1179*7c478bd9Sstevel@tonic-gate   }
1180*7c478bd9Sstevel@tonic-gate 
1181*7c478bd9Sstevel@tonic-gate   if ( free_input ) {
1182*7c478bd9Sstevel@tonic-gate     NSLDAPI_FREE( *bufp );
1183*7c478bd9Sstevel@tonic-gate   }
1184*7c478bd9Sstevel@tonic-gate   *bufp = (char *) oo;
1185*7c478bd9Sstevel@tonic-gate   *buflenp = len;
1186*7c478bd9Sstevel@tonic-gate   return( 0 );
1187*7c478bd9Sstevel@tonic-gate }
1188*7c478bd9Sstevel@tonic-gate 
1189*7c478bd9Sstevel@tonic-gate 
1190*7c478bd9Sstevel@tonic-gate static int
1191*7c478bd9Sstevel@tonic-gate hh_to_c( Byte *h )
1192*7c478bd9Sstevel@tonic-gate {
1193*7c478bd9Sstevel@tonic-gate   Byte c;
1194*7c478bd9Sstevel@tonic-gate 
1195*7c478bd9Sstevel@tonic-gate   if ( (*h >= '0') && (*h <= '9') )      c = *h++ - '0';
1196*7c478bd9Sstevel@tonic-gate   else if ( (*h >= 'A') && (*h <= 'F') ) c = *h++ - 'A' + 10;
1197*7c478bd9Sstevel@tonic-gate   else if ( (*h >= 'a') && (*h <= 'f') ) c = *h++ - 'a' + 10;
1198*7c478bd9Sstevel@tonic-gate   else return -1;
1199*7c478bd9Sstevel@tonic-gate 
1200*7c478bd9Sstevel@tonic-gate   c <<= 4;
1201*7c478bd9Sstevel@tonic-gate 
1202*7c478bd9Sstevel@tonic-gate   if ( (*h >= '0') && (*h <= '9') )      c |= *h - '0';
1203*7c478bd9Sstevel@tonic-gate   else if ( (*h >= 'A') && (*h <= 'F') ) c |= *h - 'A' + 10;
1204*7c478bd9Sstevel@tonic-gate   else if ( (*h >= 'a') && (*h <= 'f') ) c |= *h - 'a' + 10;
1205*7c478bd9Sstevel@tonic-gate   else return -1;
1206*7c478bd9Sstevel@tonic-gate 
1207*7c478bd9Sstevel@tonic-gate   return c;
1208*7c478bd9Sstevel@tonic-gate }
1209*7c478bd9Sstevel@tonic-gate 
1210*7c478bd9Sstevel@tonic-gate 
1211*7c478bd9Sstevel@tonic-gate static Byte *
1212*7c478bd9Sstevel@tonic-gate cc_to_t61( Byte *o, Byte *s )
1213*7c478bd9Sstevel@tonic-gate {
1214*7c478bd9Sstevel@tonic-gate   int n, c = 0;
1215*7c478bd9Sstevel@tonic-gate 
1216*7c478bd9Sstevel@tonic-gate   switch ( *(s + 1) ) {
1217*7c478bd9Sstevel@tonic-gate 
1218*7c478bd9Sstevel@tonic-gate   case '`':  c = -1;   break;    /* <grave-accent> */
1219*7c478bd9Sstevel@tonic-gate 
1220*7c478bd9Sstevel@tonic-gate   case '!':
1221*7c478bd9Sstevel@tonic-gate     switch ( *s ) {
1222*7c478bd9Sstevel@tonic-gate     case '!':  c = 0x7C;  break;  /* <vertical-line> */
1223*7c478bd9Sstevel@tonic-gate     case '(':  c = 0x7B;  break;  /* <left-curly-bracket> */
1224*7c478bd9Sstevel@tonic-gate     case '-':  c = 0xAD;  break;  /* <upwards-arrow> */
1225*7c478bd9Sstevel@tonic-gate     default:   c = -1;            /* <grave-accent> */
1226*7c478bd9Sstevel@tonic-gate     }
1227*7c478bd9Sstevel@tonic-gate     break;
1228*7c478bd9Sstevel@tonic-gate 
1229*7c478bd9Sstevel@tonic-gate #if (ISO_8859 == 1) || (ISO_8859 == 2) || (ISO_8859 == 3) || \
1230*7c478bd9Sstevel@tonic-gate     (ISO_8859 == 4) || (ISO_8859 == 9)
1231*7c478bd9Sstevel@tonic-gate   case 0xB4:
1232*7c478bd9Sstevel@tonic-gate #endif
1233*7c478bd9Sstevel@tonic-gate   case '\'': c = -2;  break;    /* <acute-accent> */
1234*7c478bd9Sstevel@tonic-gate 
1235*7c478bd9Sstevel@tonic-gate   case '^':  c = -3;  break;    /* <circumflex-acent> */
1236*7c478bd9Sstevel@tonic-gate 
1237*7c478bd9Sstevel@tonic-gate   case '>':
1238*7c478bd9Sstevel@tonic-gate     switch ( *s ) {
1239*7c478bd9Sstevel@tonic-gate     case ')':  c = 0x5D;  break;  /* <right-square-bracket> */
1240*7c478bd9Sstevel@tonic-gate     case '>':  c = 0xBB;  break;  /* <right-angle-quotation> */
1241*7c478bd9Sstevel@tonic-gate     case '-':  c = 0xAE;  break;  /* <rightwards-arrow> */
1242*7c478bd9Sstevel@tonic-gate     default:   c = -3;            /* <circumflex-acent> */
1243*7c478bd9Sstevel@tonic-gate     }
1244*7c478bd9Sstevel@tonic-gate     break;
1245*7c478bd9Sstevel@tonic-gate 
1246*7c478bd9Sstevel@tonic-gate   case '~':
1247*7c478bd9Sstevel@tonic-gate   case '?':  c = -4;  break;        /* <tilde> */
1248*7c478bd9Sstevel@tonic-gate 
1249*7c478bd9Sstevel@tonic-gate #if (ISO_8859 == 1) || (ISO_8859 == 4) || (ISO_8859 == 9)
1250*7c478bd9Sstevel@tonic-gate   case 0xAF:  c = -5;  break;       /* <macron> */
1251*7c478bd9Sstevel@tonic-gate #endif
1252*7c478bd9Sstevel@tonic-gate 
1253*7c478bd9Sstevel@tonic-gate   case '-':
1254*7c478bd9Sstevel@tonic-gate     switch ( *s ) {
1255*7c478bd9Sstevel@tonic-gate     case '-':  c = 0xFF; break; /* <soft-hyphen> */
1256*7c478bd9Sstevel@tonic-gate     case '<':  c = 0xAC; break; /* <leftwards arrow> */
1257*7c478bd9Sstevel@tonic-gate     case '+':  c = 0xB1; break; /* <plus-minus> */
1258*7c478bd9Sstevel@tonic-gate     case 'd':  c = 0xF3; break; /* <eth> */
1259*7c478bd9Sstevel@tonic-gate     default:   c = -5;          /* <macron> */
1260*7c478bd9Sstevel@tonic-gate     }
1261*7c478bd9Sstevel@tonic-gate     break;
1262*7c478bd9Sstevel@tonic-gate 
1263*7c478bd9Sstevel@tonic-gate #if (ISO_8859 == 2) || (ISO_8859 == 3)
1264*7c478bd9Sstevel@tonic-gate   case 0xA2:  c = -6;  break;            /* <breve> */
1265*7c478bd9Sstevel@tonic-gate #endif
1266*7c478bd9Sstevel@tonic-gate 
1267*7c478bd9Sstevel@tonic-gate   case '(':
1268*7c478bd9Sstevel@tonic-gate     if ( *s == '<' ) c = 0x5B;  /* <left-square-bracket> */
1269*7c478bd9Sstevel@tonic-gate     else             c = -6;    /* <breve> */
1270*7c478bd9Sstevel@tonic-gate     break;
1271*7c478bd9Sstevel@tonic-gate 
1272*7c478bd9Sstevel@tonic-gate #if (ISO_8859 == 2) || (ISO_8859 == 3) || (ISO_8859 == 4)
1273*7c478bd9Sstevel@tonic-gate   case 0xFF:  c = -7;  break;    /* <dot-accent> */
1274*7c478bd9Sstevel@tonic-gate #endif
1275*7c478bd9Sstevel@tonic-gate 
1276*7c478bd9Sstevel@tonic-gate   case '.':
1277*7c478bd9Sstevel@tonic-gate     switch ( *s ) {
1278*7c478bd9Sstevel@tonic-gate     case 'i':  c = 0xF5; break; /* <dotless-i> */
1279*7c478bd9Sstevel@tonic-gate     case 'L':  c = 0xE7; break; /* <L-middle-dot> */
1280*7c478bd9Sstevel@tonic-gate     case 'l':  c = 0xF7; break; /* <l-middle-dot> */
1281*7c478bd9Sstevel@tonic-gate     default:   c = -7;          /* <dot-accent> */
1282*7c478bd9Sstevel@tonic-gate     }
1283*7c478bd9Sstevel@tonic-gate     break;
1284*7c478bd9Sstevel@tonic-gate 
1285*7c478bd9Sstevel@tonic-gate #if (ISO_8859 == 1) || (ISO_8859 == 2) || (ISO_8859 == 3) || \
1286*7c478bd9Sstevel@tonic-gate     (ISO_8859 == 4) || (ISO_8859 == 9)
1287*7c478bd9Sstevel@tonic-gate   case 0xA8:  c = -8; break; /* <diaeresis> */
1288*7c478bd9Sstevel@tonic-gate #endif
1289*7c478bd9Sstevel@tonic-gate 
1290*7c478bd9Sstevel@tonic-gate   case ':':
1291*7c478bd9Sstevel@tonic-gate     if ( *s == '-')  c = 0xB8; /* <division-sign> */
1292*7c478bd9Sstevel@tonic-gate     else             c = -8;   /* <diaeresis> */
1293*7c478bd9Sstevel@tonic-gate     break;
1294*7c478bd9Sstevel@tonic-gate 
1295*7c478bd9Sstevel@tonic-gate #if (ISO_8859 == 1) || (ISO_8859 == 2) || (ISO_8859 == 3) || \
1296*7c478bd9Sstevel@tonic-gate     (ISO_8859 == 4) || (ISO_8859 == 9) || (ISO_8859 == 10)
1297*7c478bd9Sstevel@tonic-gate   case 0xB0:
1298*7c478bd9Sstevel@tonic-gate #endif
1299*7c478bd9Sstevel@tonic-gate   case '0':  c = -10;  break;  /* <ring-above> */
1300*7c478bd9Sstevel@tonic-gate 
1301*7c478bd9Sstevel@tonic-gate #if (ISO_8859 == 1) || (ISO_8859 == 2) || (ISO_8859 == 3) || \
1302*7c478bd9Sstevel@tonic-gate     (ISO_8859 == 4) || (ISO_8859 == 9)
1303*7c478bd9Sstevel@tonic-gate   case 0xB8:
1304*7c478bd9Sstevel@tonic-gate #endif
1305*7c478bd9Sstevel@tonic-gate   case ',':  c = -11; break; /* <cedilla> */
1306*7c478bd9Sstevel@tonic-gate 
1307*7c478bd9Sstevel@tonic-gate #if (ISO_8859 == 2)
1308*7c478bd9Sstevel@tonic-gate   case 0xBD:
1309*7c478bd9Sstevel@tonic-gate #endif
1310*7c478bd9Sstevel@tonic-gate   case '"':  c = -13; break; /* <double-acute-accent> */
1311*7c478bd9Sstevel@tonic-gate 
1312*7c478bd9Sstevel@tonic-gate #if (ISO_8859 == 2) || (ISO_8859 == 4)
1313*7c478bd9Sstevel@tonic-gate   case 0xB2:
1314*7c478bd9Sstevel@tonic-gate #endif
1315*7c478bd9Sstevel@tonic-gate   case ';':  c = -14; break; /* <ogonek> */
1316*7c478bd9Sstevel@tonic-gate 
1317*7c478bd9Sstevel@tonic-gate #if (ISO_8859 == 2) || (ISO_8859 == 4)
1318*7c478bd9Sstevel@tonic-gate   case 0xB7:  c = -15;  break;  /* <caron> */
1319*7c478bd9Sstevel@tonic-gate #endif
1320*7c478bd9Sstevel@tonic-gate 
1321*7c478bd9Sstevel@tonic-gate   case ')':
1322*7c478bd9Sstevel@tonic-gate     if ( *s == '!' )  c = 0x7D;  /* <left-curly-bracket> */
1323*7c478bd9Sstevel@tonic-gate     break;
1324*7c478bd9Sstevel@tonic-gate 
1325*7c478bd9Sstevel@tonic-gate   case '<':
1326*7c478bd9Sstevel@tonic-gate     if ( *s == '<' )  c = 0xAB;  /* <left-angle-quotation> */
1327*7c478bd9Sstevel@tonic-gate     else              c = -15;   /* <caron> */
1328*7c478bd9Sstevel@tonic-gate     break;
1329*7c478bd9Sstevel@tonic-gate 
1330*7c478bd9Sstevel@tonic-gate   case '/':
1331*7c478bd9Sstevel@tonic-gate     switch ( *s ) {
1332*7c478bd9Sstevel@tonic-gate     case '/':  c = 0x5C; break; /* <reverse-solidus> */
1333*7c478bd9Sstevel@tonic-gate     case 'D':  c = 0xE2; break; /* <D-stroke> */
1334*7c478bd9Sstevel@tonic-gate     case 'd':  c = 0xF2; break; /* <d-stroke> */
1335*7c478bd9Sstevel@tonic-gate     case 'H':  c = 0xE4; break; /* <H-stroke> */
1336*7c478bd9Sstevel@tonic-gate     case 'h':  c = 0xF4; break; /* <h-stroke> */
1337*7c478bd9Sstevel@tonic-gate     case 'L':  c = 0xE8; break; /* <L-stroke> */
1338*7c478bd9Sstevel@tonic-gate     case 'l':  c = 0xF8; break; /* <l-stroke> */
1339*7c478bd9Sstevel@tonic-gate     case 'O':  c = 0xE9; break; /* <O-stroke> */
1340*7c478bd9Sstevel@tonic-gate     case 'o':  c = 0xF9; break; /* <o-stroke> */
1341*7c478bd9Sstevel@tonic-gate     case 'T':  c = 0xED; break; /* <T-stroke> */
1342*7c478bd9Sstevel@tonic-gate     case 't':  c = 0xFD; break; /* <t-stroke> */
1343*7c478bd9Sstevel@tonic-gate     }
1344*7c478bd9Sstevel@tonic-gate     break;
1345*7c478bd9Sstevel@tonic-gate 
1346*7c478bd9Sstevel@tonic-gate   case '2':
1347*7c478bd9Sstevel@tonic-gate     if ( *s == '1' )  c = 0xBD;    /* <one-half> */
1348*7c478bd9Sstevel@tonic-gate     break;
1349*7c478bd9Sstevel@tonic-gate 
1350*7c478bd9Sstevel@tonic-gate   case '4':
1351*7c478bd9Sstevel@tonic-gate     switch ( *s ) {
1352*7c478bd9Sstevel@tonic-gate     case '1':  c = 0xBC; break; /* <one-quarter> */
1353*7c478bd9Sstevel@tonic-gate     case '3':  c = 0xBE; break; /* <three-quarters> */
1354*7c478bd9Sstevel@tonic-gate     }
1355*7c478bd9Sstevel@tonic-gate     break;
1356*7c478bd9Sstevel@tonic-gate 
1357*7c478bd9Sstevel@tonic-gate   case '6':
1358*7c478bd9Sstevel@tonic-gate     switch ( *s ) {
1359*7c478bd9Sstevel@tonic-gate     case '\'': c = 0xA9; break; /* <left-single-quotation> */
1360*7c478bd9Sstevel@tonic-gate     case '"':  c = 0xAA; break; /* <left-double-quotation> */
1361*7c478bd9Sstevel@tonic-gate     }
1362*7c478bd9Sstevel@tonic-gate     break;
1363*7c478bd9Sstevel@tonic-gate 
1364*7c478bd9Sstevel@tonic-gate   case '8':
1365*7c478bd9Sstevel@tonic-gate     switch ( *s ) {
1366*7c478bd9Sstevel@tonic-gate     case '1':  c = 0xDC; break; /* <one-eighth> */
1367*7c478bd9Sstevel@tonic-gate     case '3':  c = 0xDD; break; /* <three-eighths> */
1368*7c478bd9Sstevel@tonic-gate     case '5':  c = 0xDE; break; /* <five-eighths> */
1369*7c478bd9Sstevel@tonic-gate     case '7':  c = 0xDF; break; /* <seven-eighths> */
1370*7c478bd9Sstevel@tonic-gate     case 'M':  c = 0xD5; break; /* <eighth-note> */
1371*7c478bd9Sstevel@tonic-gate     }
1372*7c478bd9Sstevel@tonic-gate     break;
1373*7c478bd9Sstevel@tonic-gate 
1374*7c478bd9Sstevel@tonic-gate   case '9':
1375*7c478bd9Sstevel@tonic-gate     switch ( *s ) {
1376*7c478bd9Sstevel@tonic-gate     case '\'': c = 0xB9; break; /* <right-single-quotation> */
1377*7c478bd9Sstevel@tonic-gate     case '"':  c = 0xBA; break; /* <right-double-quotation> */
1378*7c478bd9Sstevel@tonic-gate     }
1379*7c478bd9Sstevel@tonic-gate     break;
1380*7c478bd9Sstevel@tonic-gate 
1381*7c478bd9Sstevel@tonic-gate   case 'A':
1382*7c478bd9Sstevel@tonic-gate     if ( *s == 'A' )  c = -10;  /* <ring-above> + <A> */
1383*7c478bd9Sstevel@tonic-gate     break;
1384*7c478bd9Sstevel@tonic-gate 
1385*7c478bd9Sstevel@tonic-gate   case 'a':
1386*7c478bd9Sstevel@tonic-gate     switch ( *s ) {
1387*7c478bd9Sstevel@tonic-gate     case '-':  c = 0xE3; break; /* <femenine-ordinal-a> */
1388*7c478bd9Sstevel@tonic-gate     case 'a':  c = -10;  break; /* <ring-above> + <a> */
1389*7c478bd9Sstevel@tonic-gate     }
1390*7c478bd9Sstevel@tonic-gate     break;
1391*7c478bd9Sstevel@tonic-gate 
1392*7c478bd9Sstevel@tonic-gate   case 'B':
1393*7c478bd9Sstevel@tonic-gate     if ( *s == 'B' )  c = 0xD7; /* <broken-bar> */
1394*7c478bd9Sstevel@tonic-gate     break;
1395*7c478bd9Sstevel@tonic-gate 
1396*7c478bd9Sstevel@tonic-gate   case 'b':
1397*7c478bd9Sstevel@tonic-gate     if ( *s == 'N' )  c = 0xA6;  /* <number-sign> */
1398*7c478bd9Sstevel@tonic-gate     break;
1399*7c478bd9Sstevel@tonic-gate 
1400*7c478bd9Sstevel@tonic-gate   case 'd':
1401*7c478bd9Sstevel@tonic-gate     if ( *s == 'P' )  c = 0xA3;  /* <pound-sign> */
1402*7c478bd9Sstevel@tonic-gate     break;
1403*7c478bd9Sstevel@tonic-gate 
1404*7c478bd9Sstevel@tonic-gate   case 'E':
1405*7c478bd9Sstevel@tonic-gate     switch ( *s ) {
1406*7c478bd9Sstevel@tonic-gate     case 'S':  c = 0xA7; break; /* <section-sign> */
1407*7c478bd9Sstevel@tonic-gate     case 'A':  c = 0xE1; break; /* <AE> */
1408*7c478bd9Sstevel@tonic-gate     case 'O':  c = 0xEA; break; /* <OE> */
1409*7c478bd9Sstevel@tonic-gate     }
1410*7c478bd9Sstevel@tonic-gate     break;
1411*7c478bd9Sstevel@tonic-gate 
1412*7c478bd9Sstevel@tonic-gate   case 'e':
1413*7c478bd9Sstevel@tonic-gate     switch ( *s ) {
1414*7c478bd9Sstevel@tonic-gate     case 'a':  c = 0xF1; break; /* <ae> */
1415*7c478bd9Sstevel@tonic-gate     case 'o':  c = 0xFA; break; /* <oe> */
1416*7c478bd9Sstevel@tonic-gate     case 'Y':  c = 0xA5;  break;  /* <yen-sign> */
1417*7c478bd9Sstevel@tonic-gate     }
1418*7c478bd9Sstevel@tonic-gate     break;
1419*7c478bd9Sstevel@tonic-gate 
1420*7c478bd9Sstevel@tonic-gate   case 'G':
1421*7c478bd9Sstevel@tonic-gate     switch ( *s ) {
1422*7c478bd9Sstevel@tonic-gate     case 'D':  c = 0xB0; break; /* <degree-sign> */
1423*7c478bd9Sstevel@tonic-gate     case 'N':  c = 0xEE; break; /* <Eng> */
1424*7c478bd9Sstevel@tonic-gate     }
1425*7c478bd9Sstevel@tonic-gate     break;
1426*7c478bd9Sstevel@tonic-gate 
1427*7c478bd9Sstevel@tonic-gate   case 'g':
1428*7c478bd9Sstevel@tonic-gate     switch ( *s ) {
1429*7c478bd9Sstevel@tonic-gate     case 'R':  c = 0xD2; break;  /* <registered-sign> */
1430*7c478bd9Sstevel@tonic-gate     case 'n':  c = 0xFE; break; /* <eng> */
1431*7c478bd9Sstevel@tonic-gate     }
1432*7c478bd9Sstevel@tonic-gate     break;
1433*7c478bd9Sstevel@tonic-gate 
1434*7c478bd9Sstevel@tonic-gate   case 'H':
1435*7c478bd9Sstevel@tonic-gate     if ( *s == 'T' )  c = 0xEC;  /* <Thorn> */
1436*7c478bd9Sstevel@tonic-gate     break;
1437*7c478bd9Sstevel@tonic-gate 
1438*7c478bd9Sstevel@tonic-gate   case 'h':
1439*7c478bd9Sstevel@tonic-gate     if ( *s == 't' )  c = 0xFC; /* <thorn> */
1440*7c478bd9Sstevel@tonic-gate     break;
1441*7c478bd9Sstevel@tonic-gate 
1442*7c478bd9Sstevel@tonic-gate   case 'I':
1443*7c478bd9Sstevel@tonic-gate     switch ( *s ) {
1444*7c478bd9Sstevel@tonic-gate     case 'P':  c = 0xB6; break;  /* <pilcrow-sign> */
1445*7c478bd9Sstevel@tonic-gate     case '!':  c = 0xA1; break; /* <inverted-exclamation> */
1446*7c478bd9Sstevel@tonic-gate     case '?':  c = 0xBF; break; /* <inverted-question> */
1447*7c478bd9Sstevel@tonic-gate     }
1448*7c478bd9Sstevel@tonic-gate     break;
1449*7c478bd9Sstevel@tonic-gate 
1450*7c478bd9Sstevel@tonic-gate   case 'J':
1451*7c478bd9Sstevel@tonic-gate     if ( *s == 'I' )  c = 0xE6; /* <IJ> */
1452*7c478bd9Sstevel@tonic-gate     break;
1453*7c478bd9Sstevel@tonic-gate 
1454*7c478bd9Sstevel@tonic-gate   case 'j':
1455*7c478bd9Sstevel@tonic-gate     if ( *s == 'i' )  c = 0xF6;  /* <ij> */
1456*7c478bd9Sstevel@tonic-gate     break;
1457*7c478bd9Sstevel@tonic-gate 
1458*7c478bd9Sstevel@tonic-gate   case 'k':
1459*7c478bd9Sstevel@tonic-gate     if ( *s == 'k' )  c = 0xF0; /* <kra> */
1460*7c478bd9Sstevel@tonic-gate     break;
1461*7c478bd9Sstevel@tonic-gate 
1462*7c478bd9Sstevel@tonic-gate   case 'M':
1463*7c478bd9Sstevel@tonic-gate     switch ( *s ) {
1464*7c478bd9Sstevel@tonic-gate     case '.':  c = 0xB7; break; /* <middle-dot> */
1465*7c478bd9Sstevel@tonic-gate     case '-':  c = 0xD0; break; /* <em-dash> */
1466*7c478bd9Sstevel@tonic-gate     case 'T':  c = 0xD4; break; /* <trade-mark-sign> */
1467*7c478bd9Sstevel@tonic-gate     }
1468*7c478bd9Sstevel@tonic-gate     break;
1469*7c478bd9Sstevel@tonic-gate 
1470*7c478bd9Sstevel@tonic-gate   case 'm':
1471*7c478bd9Sstevel@tonic-gate     switch ( *s ) {
1472*7c478bd9Sstevel@tonic-gate     case '\'':                  /* <macron> RFC 1345 */
1473*7c478bd9Sstevel@tonic-gate     case ' ':  c = -5;   break; /* <macron> */
1474*7c478bd9Sstevel@tonic-gate     case 'O':  c = 0xE0; break; /* <Ohm sign> */
1475*7c478bd9Sstevel@tonic-gate     }
1476*7c478bd9Sstevel@tonic-gate     break;
1477*7c478bd9Sstevel@tonic-gate 
1478*7c478bd9Sstevel@tonic-gate   case 'n':
1479*7c478bd9Sstevel@tonic-gate     if ( *s == '\'' )  c = 0xEF; /* <n-preceded-by-apostrophe> */
1480*7c478bd9Sstevel@tonic-gate     break;
1481*7c478bd9Sstevel@tonic-gate 
1482*7c478bd9Sstevel@tonic-gate   case 'O':
1483*7c478bd9Sstevel@tonic-gate     switch ( *s ) {
1484*7c478bd9Sstevel@tonic-gate     case 'D':  c = 0xA4; break; /* <dollar-sign> */
1485*7c478bd9Sstevel@tonic-gate     case 'N':  c = 0xD6; break; /* <not-sign> */
1486*7c478bd9Sstevel@tonic-gate     }
1487*7c478bd9Sstevel@tonic-gate     break;
1488*7c478bd9Sstevel@tonic-gate 
1489*7c478bd9Sstevel@tonic-gate   case 'o':
1490*7c478bd9Sstevel@tonic-gate     switch ( *s ) {
1491*7c478bd9Sstevel@tonic-gate     case 'C':  c = 0xD3; break; /* <copyright-sign> */
1492*7c478bd9Sstevel@tonic-gate     case '-':  c = 0xEB; break; /* <masculine-ordinal-o> */
1493*7c478bd9Sstevel@tonic-gate     }
1494*7c478bd9Sstevel@tonic-gate     break;
1495*7c478bd9Sstevel@tonic-gate 
1496*7c478bd9Sstevel@tonic-gate   case 'S':
1497*7c478bd9Sstevel@tonic-gate     switch ( *s ) {
1498*7c478bd9Sstevel@tonic-gate     case '1':  c = 0xD1; break; /* <superscript-1> */
1499*7c478bd9Sstevel@tonic-gate     case '2':  c = 0xB2; break; /* <superscript-2> */
1500*7c478bd9Sstevel@tonic-gate     case '3':  c = 0xB3; break; /* <superscript-3> */
1501*7c478bd9Sstevel@tonic-gate     case 'N':  c = 0xA0; break; /* <no-break-space> */
1502*7c478bd9Sstevel@tonic-gate     }
1503*7c478bd9Sstevel@tonic-gate     break;
1504*7c478bd9Sstevel@tonic-gate 
1505*7c478bd9Sstevel@tonic-gate   case 's':
1506*7c478bd9Sstevel@tonic-gate     if ( *s == 's' )  c = 0xFB; /* <sharp-s> */
1507*7c478bd9Sstevel@tonic-gate     break;
1508*7c478bd9Sstevel@tonic-gate 
1509*7c478bd9Sstevel@tonic-gate   case 't':
1510*7c478bd9Sstevel@tonic-gate     if ( *s == 'C' )  c = 0xA2; /* <cent-sign> */
1511*7c478bd9Sstevel@tonic-gate     break;
1512*7c478bd9Sstevel@tonic-gate 
1513*7c478bd9Sstevel@tonic-gate   case 'u':
1514*7c478bd9Sstevel@tonic-gate     if ( *s == 'C' )  c = 0xA8; /* <currency-sign> */
1515*7c478bd9Sstevel@tonic-gate     break;
1516*7c478bd9Sstevel@tonic-gate 
1517*7c478bd9Sstevel@tonic-gate   case 'v':
1518*7c478bd9Sstevel@tonic-gate     if ( *s == '-' )  c = 0xAF; /* <downwards-arrow> */
1519*7c478bd9Sstevel@tonic-gate     break;
1520*7c478bd9Sstevel@tonic-gate 
1521*7c478bd9Sstevel@tonic-gate   case 'X':
1522*7c478bd9Sstevel@tonic-gate     if ( *s == '*' )  c = 0xB4; /* <multiplication-sign> */
1523*7c478bd9Sstevel@tonic-gate     break;
1524*7c478bd9Sstevel@tonic-gate 
1525*7c478bd9Sstevel@tonic-gate   case 'y':
1526*7c478bd9Sstevel@tonic-gate     if ( *s == 'M' )  c = 0xB5; /* <micro-sign> */
1527*7c478bd9Sstevel@tonic-gate     break;
1528*7c478bd9Sstevel@tonic-gate   }
1529*7c478bd9Sstevel@tonic-gate 
1530*7c478bd9Sstevel@tonic-gate   if ( c > 0 ) {
1531*7c478bd9Sstevel@tonic-gate     *o++ = c;
1532*7c478bd9Sstevel@tonic-gate     return o;
1533*7c478bd9Sstevel@tonic-gate   } else if ( !c )
1534*7c478bd9Sstevel@tonic-gate     return NULL;
1535*7c478bd9Sstevel@tonic-gate 
1536*7c478bd9Sstevel@tonic-gate   /* else: c < 0 */
1537*7c478bd9Sstevel@tonic-gate   n = -c;
1538*7c478bd9Sstevel@tonic-gate   switch ( *s ) {
1539*7c478bd9Sstevel@tonic-gate 
1540*7c478bd9Sstevel@tonic-gate   case 'A':  c = letter_w_diacritic[n][0]; break;
1541*7c478bd9Sstevel@tonic-gate   case 'C':  c = letter_w_diacritic[n][1]; break;
1542*7c478bd9Sstevel@tonic-gate   case 'D':  c = letter_w_diacritic[n][2]; break;
1543*7c478bd9Sstevel@tonic-gate   case 'E':  c = letter_w_diacritic[n][3]; break;
1544*7c478bd9Sstevel@tonic-gate   case 'G':  c = letter_w_diacritic[n][4]; break;
1545*7c478bd9Sstevel@tonic-gate   case 'H':  c = letter_w_diacritic[n][5]; break;
1546*7c478bd9Sstevel@tonic-gate   case 'I':  c = letter_w_diacritic[n][6]; break;
1547*7c478bd9Sstevel@tonic-gate   case 'J':  c = letter_w_diacritic[n][7]; break;
1548*7c478bd9Sstevel@tonic-gate   case 'K':  c = letter_w_diacritic[n][8]; break;
1549*7c478bd9Sstevel@tonic-gate   case 'L':  c = letter_w_diacritic[n][9]; break;
1550*7c478bd9Sstevel@tonic-gate   case 'N':  c = letter_w_diacritic[n][10]; break;
1551*7c478bd9Sstevel@tonic-gate   case 'O':  c = letter_w_diacritic[n][11]; break;
1552*7c478bd9Sstevel@tonic-gate   case 'R':  c = letter_w_diacritic[n][12]; break;
1553*7c478bd9Sstevel@tonic-gate   case 'S':  c = letter_w_diacritic[n][13]; break;
1554*7c478bd9Sstevel@tonic-gate   case 'T':  c = letter_w_diacritic[n][14]; break;
1555*7c478bd9Sstevel@tonic-gate   case 'U':  c = letter_w_diacritic[n][15]; break;
1556*7c478bd9Sstevel@tonic-gate   case 'W':  c = letter_w_diacritic[n][16]; break;
1557*7c478bd9Sstevel@tonic-gate   case 'Y':  c = letter_w_diacritic[n][17]; break;
1558*7c478bd9Sstevel@tonic-gate   case 'Z':  c = letter_w_diacritic[n][18]; break;
1559*7c478bd9Sstevel@tonic-gate 
1560*7c478bd9Sstevel@tonic-gate   case 'a':  c = letter_w_diacritic[n][19]; break;
1561*7c478bd9Sstevel@tonic-gate   case 'c':  c = letter_w_diacritic[n][20]; break;
1562*7c478bd9Sstevel@tonic-gate   case 'd':  c = letter_w_diacritic[n][21]; break;
1563*7c478bd9Sstevel@tonic-gate   case 'e':  c = letter_w_diacritic[n][22]; break;
1564*7c478bd9Sstevel@tonic-gate   case 'g':  c = letter_w_diacritic[n][23]; break;
1565*7c478bd9Sstevel@tonic-gate   case 'h':  c = letter_w_diacritic[n][24]; break;
1566*7c478bd9Sstevel@tonic-gate   case 'i':  c = letter_w_diacritic[n][25]; break;
1567*7c478bd9Sstevel@tonic-gate   case 'j':  c = letter_w_diacritic[n][26]; break;
1568*7c478bd9Sstevel@tonic-gate   case 'k':  c = letter_w_diacritic[n][27]; break;
1569*7c478bd9Sstevel@tonic-gate   case 'l':  c = letter_w_diacritic[n][28]; break;
1570*7c478bd9Sstevel@tonic-gate   case 'n':  c = letter_w_diacritic[n][29]; break;
1571*7c478bd9Sstevel@tonic-gate   case 'o':  c = letter_w_diacritic[n][30]; break;
1572*7c478bd9Sstevel@tonic-gate   case 'r':  c = letter_w_diacritic[n][31]; break;
1573*7c478bd9Sstevel@tonic-gate   case 's':  c = letter_w_diacritic[n][32]; break;
1574*7c478bd9Sstevel@tonic-gate   case 't':  c = letter_w_diacritic[n][33]; break;
1575*7c478bd9Sstevel@tonic-gate   case 'u':  c = letter_w_diacritic[n][34]; break;
1576*7c478bd9Sstevel@tonic-gate   case 'w':  c = letter_w_diacritic[n][35]; break;
1577*7c478bd9Sstevel@tonic-gate   case 'y':  c = letter_w_diacritic[n][36]; break;
1578*7c478bd9Sstevel@tonic-gate   case 'z':  c = letter_w_diacritic[n][37]; break;
1579*7c478bd9Sstevel@tonic-gate 
1580*7c478bd9Sstevel@tonic-gate   case '\'':
1581*7c478bd9Sstevel@tonic-gate   case ' ':  c = -1; break;
1582*7c478bd9Sstevel@tonic-gate 
1583*7c478bd9Sstevel@tonic-gate   default:   c = 0;
1584*7c478bd9Sstevel@tonic-gate   }
1585*7c478bd9Sstevel@tonic-gate 
1586*7c478bd9Sstevel@tonic-gate   if ( !c )
1587*7c478bd9Sstevel@tonic-gate     return NULL;
1588*7c478bd9Sstevel@tonic-gate 
1589*7c478bd9Sstevel@tonic-gate   *o++ = n + 0xC0;
1590*7c478bd9Sstevel@tonic-gate   *o++ = ( ( (*s == ' ') || (*s == '\'') ) ? ALONE : *s );
1591*7c478bd9Sstevel@tonic-gate   return o;
1592*7c478bd9Sstevel@tonic-gate }
1593*7c478bd9Sstevel@tonic-gate 
1594*7c478bd9Sstevel@tonic-gate 
1595*7c478bd9Sstevel@tonic-gate /* --- routine to convert from ISO 8859-n to T.61 --- */
1596*7c478bd9Sstevel@tonic-gate 
1597*7c478bd9Sstevel@tonic-gate int
1598*7c478bd9Sstevel@tonic-gate ldap_8859_to_t61( char **bufp, unsigned long *buflenp, int free_input )
1599*7c478bd9Sstevel@tonic-gate {
1600*7c478bd9Sstevel@tonic-gate   Byte		*s, *oo, *o, *aux;
1601*7c478bd9Sstevel@tonic-gate   int		c;
1602*7c478bd9Sstevel@tonic-gate   unsigned long len;
1603*7c478bd9Sstevel@tonic-gate   Couple	*cc;
1604*7c478bd9Sstevel@tonic-gate 
1605*7c478bd9Sstevel@tonic-gate   LDAPDebug( LDAP_DEBUG_TRACE, "ldap_8859_to_t61 input length: %ld\n",
1606*7c478bd9Sstevel@tonic-gate 	*buflenp, 0, 0 );
1607*7c478bd9Sstevel@tonic-gate 
1608*7c478bd9Sstevel@tonic-gate   len = *buflenp;
1609*7c478bd9Sstevel@tonic-gate   s = (Byte *) *bufp;
1610*7c478bd9Sstevel@tonic-gate 
1611*7c478bd9Sstevel@tonic-gate   if ( (o = oo = (Byte *)NSLDAPI_MALLOC( 2 * len + 64 )) == NULL ) {
1612*7c478bd9Sstevel@tonic-gate         return( 1 );
1613*7c478bd9Sstevel@tonic-gate   }
1614*7c478bd9Sstevel@tonic-gate 
1615*7c478bd9Sstevel@tonic-gate   while ( (char *)s - *(char **)bufp < len ) {
1616*7c478bd9Sstevel@tonic-gate     switch( *s >> 5 ) {
1617*7c478bd9Sstevel@tonic-gate 
1618*7c478bd9Sstevel@tonic-gate     case 2:
1619*7c478bd9Sstevel@tonic-gate       switch ( *s ) {
1620*7c478bd9Sstevel@tonic-gate 
1621*7c478bd9Sstevel@tonic-gate       case '^':  *o++ = 0xC3; *o++ = ALONE; s++; break;
1622*7c478bd9Sstevel@tonic-gate 
1623*7c478bd9Sstevel@tonic-gate       case '\\':
1624*7c478bd9Sstevel@tonic-gate         s++;
1625*7c478bd9Sstevel@tonic-gate         if ( (c = hh_to_c( s )) != -1 ) {
1626*7c478bd9Sstevel@tonic-gate           *o++ = c;
1627*7c478bd9Sstevel@tonic-gate           s += 2;
1628*7c478bd9Sstevel@tonic-gate         } else
1629*7c478bd9Sstevel@tonic-gate           *o++ = '\\';
1630*7c478bd9Sstevel@tonic-gate         break;
1631*7c478bd9Sstevel@tonic-gate 
1632*7c478bd9Sstevel@tonic-gate       default:  *o++ = *s++;
1633*7c478bd9Sstevel@tonic-gate       }
1634*7c478bd9Sstevel@tonic-gate       break;
1635*7c478bd9Sstevel@tonic-gate 
1636*7c478bd9Sstevel@tonic-gate     case 3:
1637*7c478bd9Sstevel@tonic-gate       switch ( *s ) {
1638*7c478bd9Sstevel@tonic-gate 
1639*7c478bd9Sstevel@tonic-gate       case '`':  *o++ = 0xC1; *o++ = ALONE; s++; break;
1640*7c478bd9Sstevel@tonic-gate       case '~':  *o++ = 0xC4; *o++ = ALONE; s++; break;
1641*7c478bd9Sstevel@tonic-gate 
1642*7c478bd9Sstevel@tonic-gate       case '{':
1643*7c478bd9Sstevel@tonic-gate         s++;
1644*7c478bd9Sstevel@tonic-gate         if ( *(s + 2) == '}' ) {
1645*7c478bd9Sstevel@tonic-gate           if ( (aux = cc_to_t61( o, s )) != NULL ) {
1646*7c478bd9Sstevel@tonic-gate             o = aux;
1647*7c478bd9Sstevel@tonic-gate             s += 3;
1648*7c478bd9Sstevel@tonic-gate           } else {
1649*7c478bd9Sstevel@tonic-gate             *o++ = '{';
1650*7c478bd9Sstevel@tonic-gate           }
1651*7c478bd9Sstevel@tonic-gate         } else if ( (*(s + 3) == '}') && ( (*s == 'x') || (*s == 'X') ) &&
1652*7c478bd9Sstevel@tonic-gate                     ( (c = hh_to_c( s + 1 )) != -1 ) ) {
1653*7c478bd9Sstevel@tonic-gate           *o++ = c;
1654*7c478bd9Sstevel@tonic-gate           s += 4;
1655*7c478bd9Sstevel@tonic-gate         } else {
1656*7c478bd9Sstevel@tonic-gate           *o++ = '{';
1657*7c478bd9Sstevel@tonic-gate         }
1658*7c478bd9Sstevel@tonic-gate         break;
1659*7c478bd9Sstevel@tonic-gate 
1660*7c478bd9Sstevel@tonic-gate       default:
1661*7c478bd9Sstevel@tonic-gate         *o++ = *s++;
1662*7c478bd9Sstevel@tonic-gate       }
1663*7c478bd9Sstevel@tonic-gate       break;
1664*7c478bd9Sstevel@tonic-gate 
1665*7c478bd9Sstevel@tonic-gate #if (ISO_8859 == 0)
1666*7c478bd9Sstevel@tonic-gate     case 4: case 5: case 6: case 7:
1667*7c478bd9Sstevel@tonic-gate       s++;
1668*7c478bd9Sstevel@tonic-gate       break;
1669*7c478bd9Sstevel@tonic-gate #else
1670*7c478bd9Sstevel@tonic-gate     case 5: case 6: case 7:
1671*7c478bd9Sstevel@tonic-gate # if (ISO_8859 == 1) || (ISO_8859 == 2) || (ISO_8859 == 3) || \
1672*7c478bd9Sstevel@tonic-gate      (ISO_8859 == 4) || (ISO_8859 == 9) || (ISO_8859 == 10)
1673*7c478bd9Sstevel@tonic-gate       if ( (*(cc = &trans_iso8859_t61[ *s - 0xA0 ])).a ) {
1674*7c478bd9Sstevel@tonic-gate 	*o++ = (*cc).a;
1675*7c478bd9Sstevel@tonic-gate 	if ( (*cc).b )  *o++ = (*cc).b;
1676*7c478bd9Sstevel@tonic-gate       }
1677*7c478bd9Sstevel@tonic-gate # endif
1678*7c478bd9Sstevel@tonic-gate       s++;
1679*7c478bd9Sstevel@tonic-gate       break;
1680*7c478bd9Sstevel@tonic-gate #endif
1681*7c478bd9Sstevel@tonic-gate 
1682*7c478bd9Sstevel@tonic-gate     default:
1683*7c478bd9Sstevel@tonic-gate       *o++ = *s++;
1684*7c478bd9Sstevel@tonic-gate     }
1685*7c478bd9Sstevel@tonic-gate   }
1686*7c478bd9Sstevel@tonic-gate 
1687*7c478bd9Sstevel@tonic-gate   len = o - oo;
1688*7c478bd9Sstevel@tonic-gate   o = oo;
1689*7c478bd9Sstevel@tonic-gate 
1690*7c478bd9Sstevel@tonic-gate   if ( (oo = (Byte *)NSLDAPI_REALLOC( o, len )) == NULL ) {
1691*7c478bd9Sstevel@tonic-gate     NSLDAPI_FREE( o );
1692*7c478bd9Sstevel@tonic-gate     return( 1 );
1693*7c478bd9Sstevel@tonic-gate   }
1694*7c478bd9Sstevel@tonic-gate 
1695*7c478bd9Sstevel@tonic-gate   if ( free_input ) {
1696*7c478bd9Sstevel@tonic-gate     NSLDAPI_FREE( *bufp );
1697*7c478bd9Sstevel@tonic-gate   }
1698*7c478bd9Sstevel@tonic-gate   *bufp = (char *) oo;
1699*7c478bd9Sstevel@tonic-gate   *buflenp = len;
1700*7c478bd9Sstevel@tonic-gate   return( 0 );
1701*7c478bd9Sstevel@tonic-gate }
1702*7c478bd9Sstevel@tonic-gate 
1703*7c478bd9Sstevel@tonic-gate 
1704*7c478bd9Sstevel@tonic-gate #ifdef NOT_NEEDED_IN_LIBLDAP	/* mcs@umich.edu 12 Oct 1995 */
1705*7c478bd9Sstevel@tonic-gate /* --- routine to convert "escaped" (\hh) characters to 8bits --- */
1706*7c478bd9Sstevel@tonic-gate 
1707*7c478bd9Sstevel@tonic-gate void convert_escaped_to_8bit( s )
1708*7c478bd9Sstevel@tonic-gate char	*s;
1709*7c478bd9Sstevel@tonic-gate {
1710*7c478bd9Sstevel@tonic-gate   char	*o = s;
1711*7c478bd9Sstevel@tonic-gate   int	c;
1712*7c478bd9Sstevel@tonic-gate 
1713*7c478bd9Sstevel@tonic-gate   while ( *s ) {
1714*7c478bd9Sstevel@tonic-gate     if ( *s == '\\' ) {
1715*7c478bd9Sstevel@tonic-gate       if ( (c = hh_to_c( ++s )) != -1 ) {
1716*7c478bd9Sstevel@tonic-gate 	*o++ = c;
1717*7c478bd9Sstevel@tonic-gate 	s += 2;
1718*7c478bd9Sstevel@tonic-gate       } else
1719*7c478bd9Sstevel@tonic-gate         *o++ = '\\';
1720*7c478bd9Sstevel@tonic-gate     } else
1721*7c478bd9Sstevel@tonic-gate       *o++ = *s++;
1722*7c478bd9Sstevel@tonic-gate   }
1723*7c478bd9Sstevel@tonic-gate   *o = '\0';
1724*7c478bd9Sstevel@tonic-gate }
1725*7c478bd9Sstevel@tonic-gate 
1726*7c478bd9Sstevel@tonic-gate /* --- routine to convert 8bits characters to the "escaped" (\hh) form --- */
1727*7c478bd9Sstevel@tonic-gate 
1728*7c478bd9Sstevel@tonic-gate char *convert_8bit_to_escaped( s )
1729*7c478bd9Sstevel@tonic-gate Byte  *s;
1730*7c478bd9Sstevel@tonic-gate {
1731*7c478bd9Sstevel@tonic-gate   Byte	*o, *oo;
1732*7c478bd9Sstevel@tonic-gate   Byte	n;
1733*7c478bd9Sstevel@tonic-gate 
1734*7c478bd9Sstevel@tonic-gate   if ( (o = oo = (Byte *)NSLDAPI_MALLOC( 2 * strlen( s ) + 64 )) == NULL ) {
1735*7c478bd9Sstevel@tonic-gate         return( NULL );
1736*7c478bd9Sstevel@tonic-gate   }
1737*7c478bd9Sstevel@tonic-gate 
1738*7c478bd9Sstevel@tonic-gate   while ( *s ) {
1739*7c478bd9Sstevel@tonic-gate     if ( *s < 0x80 )
1740*7c478bd9Sstevel@tonic-gate       *o++ = *s++;
1741*7c478bd9Sstevel@tonic-gate     else {
1742*7c478bd9Sstevel@tonic-gate       *o++ = '\\';
1743*7c478bd9Sstevel@tonic-gate       n = *s >> 4;
1744*7c478bd9Sstevel@tonic-gate       *o++ = ((n < 0xA) ? '0' : 'A' - 0xA) + n;
1745*7c478bd9Sstevel@tonic-gate       n = *s++ & 0x0F;
1746*7c478bd9Sstevel@tonic-gate       *o++ = ((n < 0xA) ? '0' : 'A' - 0xA) + n;
1747*7c478bd9Sstevel@tonic-gate     }
1748*7c478bd9Sstevel@tonic-gate   }
1749*7c478bd9Sstevel@tonic-gate   *o = '\0';
1750*7c478bd9Sstevel@tonic-gate 
1751*7c478bd9Sstevel@tonic-gate   o = oo;
1752*7c478bd9Sstevel@tonic-gate 
1753*7c478bd9Sstevel@tonic-gate   if ( (oo = (Byte *)NSLDAPI_REALLOC( o, strlen( o ) + 1 )) == NULL ) {
1754*7c478bd9Sstevel@tonic-gate     NSLDAPI_FREE( o );
1755*7c478bd9Sstevel@tonic-gate     return( NULL );
1756*7c478bd9Sstevel@tonic-gate   }
1757*7c478bd9Sstevel@tonic-gate 
1758*7c478bd9Sstevel@tonic-gate   return( (char *)oo );
1759*7c478bd9Sstevel@tonic-gate }
1760*7c478bd9Sstevel@tonic-gate 
1761*7c478bd9Sstevel@tonic-gate /* --- routine to convert from T.61 to printable characters --- */
1762*7c478bd9Sstevel@tonic-gate 
1763*7c478bd9Sstevel@tonic-gate /*
1764*7c478bd9Sstevel@tonic-gate    printable characters [RFC 1488]: 'A'..'Z', 'a'..'z', '0'..'9',
1765*7c478bd9Sstevel@tonic-gate        '\'', '(', ')', '+', ',', '-', '.', '/', ':', '?, ' '.
1766*7c478bd9Sstevel@tonic-gate 
1767*7c478bd9Sstevel@tonic-gate    that conversion is language dependent.
1768*7c478bd9Sstevel@tonic-gate */
1769*7c478bd9Sstevel@tonic-gate 
1770*7c478bd9Sstevel@tonic-gate static Couple last_t61_printabled[32] = {
1771*7c478bd9Sstevel@tonic-gate 	{0,0},     {'A','E'}, {'D',0},   {0,0},
1772*7c478bd9Sstevel@tonic-gate 	{'H',0},   {0,0},     {'I','J'}, {'L',0},
1773*7c478bd9Sstevel@tonic-gate 	{'L',0},   {'O',0},   {'O','E'}, {0,0},
1774*7c478bd9Sstevel@tonic-gate 	{'T','H'}, {'T',0},   {'N','G'}, {'n',0},
1775*7c478bd9Sstevel@tonic-gate 	{'k',0},   {'a','e'}, {'d',0},   {'d',0},
1776*7c478bd9Sstevel@tonic-gate 	{'h',0},   {'i',0},   {'i','j'}, {'l',0},
1777*7c478bd9Sstevel@tonic-gate 	{'l',0},   {'o',0},   {'o','e'}, {'s','s'},
1778*7c478bd9Sstevel@tonic-gate 	{'t','h'}, {'t',0},   {'n','g'}, {0,0}
1779*7c478bd9Sstevel@tonic-gate };
1780*7c478bd9Sstevel@tonic-gate 
1781*7c478bd9Sstevel@tonic-gate char *t61_printable( s )
1782*7c478bd9Sstevel@tonic-gate Byte  *s;
1783*7c478bd9Sstevel@tonic-gate {
1784*7c478bd9Sstevel@tonic-gate   Byte   *o, *oo;
1785*7c478bd9Sstevel@tonic-gate   Byte   n;
1786*7c478bd9Sstevel@tonic-gate   Couple *cc;
1787*7c478bd9Sstevel@tonic-gate 
1788*7c478bd9Sstevel@tonic-gate   if ( (o = oo = (Byte *)NSLDAPI_MALLOC( 2 * strlen( s ) + 64 )) == NULL ) {
1789*7c478bd9Sstevel@tonic-gate         return( NULL );
1790*7c478bd9Sstevel@tonic-gate   }
1791*7c478bd9Sstevel@tonic-gate 
1792*7c478bd9Sstevel@tonic-gate   while ( *s ) {
1793*7c478bd9Sstevel@tonic-gate     if ( ( (*s >= 'A') && (*s <= 'Z') ) ||
1794*7c478bd9Sstevel@tonic-gate          ( (*s >= 'a') && (*s <= 'z') ) ||
1795*7c478bd9Sstevel@tonic-gate          ( (*s >= '0') && (*s <= '9') ) ||
1796*7c478bd9Sstevel@tonic-gate          ( (*s >= '\'') && (*s <= ')') ) ||
1797*7c478bd9Sstevel@tonic-gate          ( (*s >= '+') && (*s <= '/') ) ||
1798*7c478bd9Sstevel@tonic-gate          ( *s == '?' ) || ( *s == ' ' ) )
1799*7c478bd9Sstevel@tonic-gate       *o++ = *s++;
1800*7c478bd9Sstevel@tonic-gate     else {
1801*7c478bd9Sstevel@tonic-gate       if ( *s >= 0xE0 ) {
1802*7c478bd9Sstevel@tonic-gate 	if ( (*(cc = &last_t61_printabled[ *s - 0xE0 ])).a ) {
1803*7c478bd9Sstevel@tonic-gate           *o++ = (*cc).a;
1804*7c478bd9Sstevel@tonic-gate           if ( (*cc).b )  *o++ = (*cc).b;
1805*7c478bd9Sstevel@tonic-gate         }
1806*7c478bd9Sstevel@tonic-gate       }
1807*7c478bd9Sstevel@tonic-gate       else if ( (*s >> 4) == 0xC ) {
1808*7c478bd9Sstevel@tonic-gate         switch ( *s ) {
1809*7c478bd9Sstevel@tonic-gate 	case 0xCA:			/* ring */
1810*7c478bd9Sstevel@tonic-gate 	  switch ( *(s + 1) ) {
1811*7c478bd9Sstevel@tonic-gate 	  case 'A':  *o++ = 'A'; *o++ = 'A'; s++; break; /* Swedish */
1812*7c478bd9Sstevel@tonic-gate 	  case 'a':  *o++ = 'a'; *o++ = 'a'; s++; break; /* Swedish */
1813*7c478bd9Sstevel@tonic-gate 	  }
1814*7c478bd9Sstevel@tonic-gate 	  break;
1815*7c478bd9Sstevel@tonic-gate 
1816*7c478bd9Sstevel@tonic-gate 	case 0xC8:			/* diaeresis */
1817*7c478bd9Sstevel@tonic-gate 	  switch ( *(s + 1) ) {
1818*7c478bd9Sstevel@tonic-gate 	  case 'Y':  *o++ = 'I'; *o++ = 'J'; s++; break; /* Dutch */
1819*7c478bd9Sstevel@tonic-gate 	  case 'y':  *o++ = 'i'; *o++ = 'j'; s++; break; /* Dutch */
1820*7c478bd9Sstevel@tonic-gate           }
1821*7c478bd9Sstevel@tonic-gate 	  break;
1822*7c478bd9Sstevel@tonic-gate         }
1823*7c478bd9Sstevel@tonic-gate       }
1824*7c478bd9Sstevel@tonic-gate       s++;
1825*7c478bd9Sstevel@tonic-gate     }
1826*7c478bd9Sstevel@tonic-gate   }
1827*7c478bd9Sstevel@tonic-gate   *o = '\0';
1828*7c478bd9Sstevel@tonic-gate 
1829*7c478bd9Sstevel@tonic-gate   o = oo;
1830*7c478bd9Sstevel@tonic-gate 
1831*7c478bd9Sstevel@tonic-gate   if ( (oo = (Byte *)NSLDAPI_REALLOC( o, strlen( o ) + 1 )) == NULL ) {
1832*7c478bd9Sstevel@tonic-gate     NSLDAPI_FREE( o );
1833*7c478bd9Sstevel@tonic-gate     return( NULL );
1834*7c478bd9Sstevel@tonic-gate   }
1835*7c478bd9Sstevel@tonic-gate 
1836*7c478bd9Sstevel@tonic-gate   return( (char *)oo );
1837*7c478bd9Sstevel@tonic-gate }
1838*7c478bd9Sstevel@tonic-gate #endif /* NOT_NEEDED_IN_LIBLDAP */	/* mcs@umich.edu 12 Oct 1995 */
1839*7c478bd9Sstevel@tonic-gate 
1840*7c478bd9Sstevel@tonic-gate #endif /* LDAP_CHARSET_8859 */
1841*7c478bd9Sstevel@tonic-gate #endif /* STR_TRANSLATION */
1842