From: Kurt Zeilenga Date: Mon, 5 Jun 2000 19:22:19 +0000 (+0000) Subject: remove old STR_TRANSLATION feature. The use of this feature X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~2752 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c1117666b1e978b2bb6d3b671ed3ab1fc46a66ff;p=openldap remove old STR_TRANSLATION feature. The use of this feature was only of limited use with LDAPv2 (worked okay if no non-T.61 values existed) but downright dangerous in the face of LDAPv3. Any translation must be schema aware and the BER isn't. --- diff --git a/configure b/configure index 7ead2fee00..65cb231cc5 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # $OpenLDAP$ -# from OpenLDAP: pkg/ldap/configure.in,v 1.305 2000/06/01 21:00:24 kurt Exp +# from OpenLDAP: pkg/ldap/configure.in,v 1.306 2000/06/05 05:19:11 kurt Exp # Copyright 1998-2000 The OpenLDAP Foundation. All Rights Reserved. # diff --git a/include/lber.h b/include/lber.h index fb49db32b2..833d894e06 100644 --- a/include/lber.h +++ b/include/lber.h @@ -80,15 +80,9 @@ LDAP_BEGIN_DECL #define LBER_SEQUENCE ((ber_tag_t) 0x30UL) /* constructed */ #define LBER_SET ((ber_tag_t) 0x31UL) /* constructed */ -typedef int (*BERTranslateProc) LDAP_P(( - char **bufp, - ber_len_t *buflenp, - int free_input )); - /* LBER BerElement options */ #define LBER_USE_DER 0x01 #define LBER_USE_INDEFINITE_LEN 0x02 -#define LBER_TRANSLATE_STRINGS 0x04 /* deprecated */ /* get/set options for BerElement */ #define LBER_OPT_BER_OPTIONS 0x01 @@ -306,12 +300,6 @@ ber_scanf LDAP_P(( LDAP_CONST char *fmt, ... )); -LIBLBER_F( void ) -ber_set_string_translators LDAP_P(( - BerElement *ber, - BERTranslateProc encode_proc, - BERTranslateProc decode_proc )); - /* * in encode.c */ diff --git a/include/ldap.h b/include/ldap.h index 0bba88ef4b..c8094a04ec 100644 --- a/include/ldap.h +++ b/include/ldap.h @@ -44,7 +44,7 @@ LDAP_BEGIN_DECL #define LDAP_API_VERSION 2004 #define LDAP_VENDOR_NAME "OpenLDAP" /* We'll eventually release as 200 */ -#define LDAP_VENDOR_VERSION 194 +#define LDAP_VENDOR_VERSION 19905 /* OpenLDAP API Features */ #define LDAP_API_FEATURE_X_OPENLDAP LDAP_VENDOR_VERSION @@ -1574,49 +1574,6 @@ ldap_url_search_st LDAP_P(( struct timeval *timeout, LDAPMessage **res )); - -/* - * in charset.c - * DEPRECATED - */ -LIBLDAP_F( void ) -ldap_set_string_translators LDAP_P(( - LDAP *ld, - BERTranslateProc encode_proc, - BERTranslateProc decode_proc )); - -LIBLDAP_F( int ) -ldap_translate_from_t61 LDAP_P(( - LDAP *ld, - char **bufp, - ber_len_t *lenp, - int free_input )); - -LIBLDAP_F( int ) -ldap_translate_to_t61 LDAP_P(( - LDAP *ld, - char **bufp, - ber_len_t *lenp, - int free_input )); - -LIBLDAP_F( void ) -ldap_enable_translation LDAP_P(( - LDAP *ld, - LDAPMessage *entry, - int enable )); - -LIBLDAP_F( int ) -ldap_t61_to_8859 LDAP_P(( - char **bufp, - ber_len_t *buflenp, - int free_input )); - -LIBLDAP_F( int ) -ldap_8859_to_t61 LDAP_P(( - char **bufp, - ber_len_t *buflenp, - int free_input )); - LDAP_END_DECL #endif /* _LDAP_H */ diff --git a/libraries/liblber/decode.c b/libraries/liblber/decode.c index ca24e89c38..99ff60b908 100644 --- a/libraries/liblber/decode.c +++ b/libraries/liblber/decode.c @@ -245,10 +245,6 @@ ber_get_stringb( ber_len_t datalen; ber_tag_t tag; -#ifdef STR_TRANSLATION - char *transbuf; -#endif /* STR_TRANSLATION */ - assert( ber != NULL ); assert( BER_VALID( ber ) ); @@ -262,25 +258,6 @@ ber_get_stringb( buf[datalen] = '\0'; -#ifdef STR_TRANSLATION - if ( datalen > 0 && ( ber->ber_options & LBER_TRANSLATE_STRINGS ) != 0 - && ber->ber_decode_translate_proc ) { - transbuf = buf; - ++datalen; - if ( (*(ber->ber_decode_translate_proc))( &transbuf, &datalen, - 0 ) != 0 ) { - return( LBER_DEFAULT ); - } - if ( datalen > *len ) { - LBER_FREE( transbuf ); - return( LBER_DEFAULT ); - } - SAFEMEMCPY( buf, transbuf, datalen ); - LBER_FREE( transbuf ); - --datalen; - } -#endif /* STR_TRANSLATION */ - *len = datalen; return( tag ); } @@ -311,19 +288,6 @@ ber_get_stringa( BerElement *ber, char **buf ) } (*buf)[datalen] = '\0'; -#ifdef STR_TRANSLATION - if ( datalen > 0 && ( ber->ber_options & LBER_TRANSLATE_STRINGS ) != 0 - && ber->ber_decode_translate_proc ) { - ++datalen; - if ( (*(ber->ber_decode_translate_proc))( buf, &datalen, 1 ) - != 0 ) { - LBER_FREE( *buf ); - *buf = NULL; - return( LBER_DEFAULT ); - } - } -#endif /* STR_TRANSLATION */ - return( tag ); } @@ -360,20 +324,6 @@ ber_get_stringal( BerElement *ber, struct berval **bv ) ((*bv)->bv_val)[len] = '\0'; (*bv)->bv_len = len; -#ifdef STR_TRANSLATION - if ( len > 0 && ( ber->ber_options & LBER_TRANSLATE_STRINGS ) != 0 - && ber->ber_decode_translate_proc ) { - ++len; - if ( (*(ber->ber_decode_translate_proc))( &((*bv)->bv_val), - &len, 1 ) != 0 ) { - ber_bvfree( *bv ); - *bv = NULL; - return( LBER_DEFAULT ); - } - (*bv)->bv_len = len - 1; - } -#endif /* STR_TRANSLATION */ - return( tag ); } @@ -778,17 +728,3 @@ ber_scanf ( BerElement *ber, return( rc ); } - - -#ifdef STR_TRANSLATION -void -ber_set_string_translators( BerElement *ber, BERTranslateProc encode_proc, - BERTranslateProc decode_proc ) -{ - assert( ber != NULL ); - assert( BER_VALID( ber ) ); - - ber->ber_encode_translate_proc = encode_proc; - ber->ber_decode_translate_proc = decode_proc; -} -#endif /* STR_TRANSLATION */ diff --git a/libraries/liblber/encode.c b/libraries/liblber/encode.c index 6ad945d649..68f321d8be 100644 --- a/libraries/liblber/encode.c +++ b/libraries/liblber/encode.c @@ -278,9 +278,6 @@ ber_put_ostring( { ber_len_t taglen, lenlen; int rc; -#ifdef STR_TRANSLATION - int free_str; -#endif /* STR_TRANSLATION */ assert( ber != NULL ); assert( str != NULL ); @@ -293,18 +290,6 @@ ber_put_ostring( if ( (taglen = ber_put_tag( ber, tag, 0 )) == -1 ) return( -1 ); -#ifdef STR_TRANSLATION - if ( len > 0 && ( ber->ber_options & LBER_TRANSLATE_STRINGS ) != 0 && - ber->ber_encode_translate_proc ) { - if ( (*(ber->ber_encode_translate_proc))( &str, &len, 0 ) != 0 ) { - return( -1 ); - } - free_str = 1; - } else { - free_str = 0; - } -#endif /* STR_TRANSLATION */ - if ( (lenlen = ber_put_len( ber, len, 0 )) == -1 || (ber_len_t) ber_write( ber, str, len, 0 ) != len ) { rc = -1; @@ -313,12 +298,6 @@ ber_put_ostring( rc = taglen + lenlen + len; } -#ifdef STR_TRANSLATION - if ( free_str ) { - LBER_FREE( str ); - } -#endif /* STR_TRANSLATION */ - return( rc ); } diff --git a/libraries/liblber/lber-int.h b/libraries/liblber/lber-int.h index 70d10c0447..136ea0c024 100644 --- a/libraries/liblber/lber-int.h +++ b/libraries/liblber/lber-int.h @@ -57,8 +57,6 @@ struct berelement { struct seqorset *ber_sos; char *ber_rwptr; - BERTranslateProc ber_encode_translate_proc; - BERTranslateProc ber_decode_translate_proc; }; #define BER_VALID(ber) ((ber)->ber_valid==LBER_VALID_BERELEMENT) diff --git a/libraries/libldap/Makefile.in b/libraries/libldap/Makefile.in index 56bc4cb4e2..7bc088ec28 100644 --- a/libraries/libldap/Makefile.in +++ b/libraries/libldap/Makefile.in @@ -15,7 +15,7 @@ SRCS = bind.c open.c result.c error.c compare.c search.c \ getfilter.c sasl.c sbind.c kbind.c unbind.c friendly.c cldap.c \ free.c disptmpl.c srchpref.c dsparse.c tmplout.c sort.c \ getdn.c getentry.c getattr.c getvalues.c addentry.c \ - request.c os-ip.c url.c charset.c \ + request.c os-ip.c url.c \ init.c options.c print.c string.c util-int.c schema.c \ charray.c digest.c tls.c dn.c os-local.c dnssrv.c \ utf-8.c @@ -25,7 +25,7 @@ OBJS = bind.lo open.lo result.lo error.lo compare.lo search.lo \ getfilter.lo sasl.lo sbind.lo kbind.lo unbind.lo friendly.lo cldap.lo \ free.lo disptmpl.lo srchpref.lo dsparse.lo tmplout.lo sort.lo \ getdn.lo getentry.lo getattr.lo getvalues.lo addentry.lo \ - request.lo os-ip.lo url.lo charset.lo \ + request.lo os-ip.lo url.lo \ init.lo options.lo print.lo string.lo util-int.lo schema.lo \ charray.lo digest.lo tls.lo dn.lo os-local.lo dnssrv.lo \ utf-8.lo diff --git a/libraries/libldap/charset.c b/libraries/libldap/charset.c deleted file mode 100644 index d83752ffc6..0000000000 --- a/libraries/libldap/charset.c +++ /dev/null @@ -1,1804 +0,0 @@ -/* $OpenLDAP$ */ -/* - * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved. - * COPYING RESTRICTIONS APPLY, see COPYRIGHT file - */ -/* Portions - * Copyright (c) 1995 Regents of the University of Michigan. - * All rights reserved. - * - * charset.c - */ - -#include "portable.h" - -#ifdef STR_TRANSLATION - -#include - -#include - -#include -#include -#include -#include - - -#include "ldap-int.h" - - -void -ldap_set_string_translators( LDAP *ld, BERTranslateProc encode_proc, - BERTranslateProc decode_proc ) -{ - ld->ld_lber_encode_translate_proc = encode_proc; - ld->ld_lber_decode_translate_proc = decode_proc; -} - - -void -ldap_enable_translation( LDAP *ld, LDAPMessage *entry, int enable ) -{ - unsigned short *optionsp; - - optionsp = ( entry == NULL ) ? &ld->ld_lberoptions : - &entry->lm_ber->ber_options; - - if ( enable ) { - *optionsp |= LBER_TRANSLATE_STRINGS; - } else { - *optionsp &= ~LBER_TRANSLATE_STRINGS; - } -} - - -int -ldap_translate_from_t61( LDAP *ld, char **bufp, ber_len_t *lenp, - int free_input ) -{ - if ( ld->ld_lber_decode_translate_proc == 0 ) { - return( LDAP_SUCCESS ); - } - - return( (*ld->ld_lber_decode_translate_proc)( bufp, lenp, free_input )); -} - - -int -ldap_translate_to_t61( LDAP *ld, char **bufp, ber_len_t *lenp, - int free_input ) -{ - if ( ld->ld_lber_encode_translate_proc == 0 ) { - return( LDAP_SUCCESS ); - } - - return( (*ld->ld_lber_encode_translate_proc)( bufp, lenp, free_input )); -} - - -/* - ** Character translation routine notes: - * - * On entry: bufp points to a "string" to be converted (not necessarily - * zero-terminated) and buflenp points to the length of the buffer. - * - * On exit: bufp should point to a malloc'd result. If free_input is - * non-zero then the original bufp will be freed. *buflenp should be - * set to the new length. Zero bytes in the input buffer must be left - * as zero bytes. - * - * Return values: any ldap error code (LDAP_SUCCESS if all goes well). - */ - - -#ifdef LDAP_CHARSET_8859 - -#if LDAP_CHARSET_8859 == 88591 -#define ISO_8859 1 -#elif LDAP_CHARSET_8859 == 88592 -#define ISO_8859 2 -#elif LDAP_CHARSET_8859 == 88593 -#define ISO_8859 3 -#elif LDAP_CHARSET_8859 == 88594 -#define ISO_8859 4 -#elif LDAP_CHARSET_8859 == 88595 -#define ISO_8859 5 -#elif LDAP_CHARSET_8859 == 88596 -#define ISO_8859 6 -#elif LDAP_CHARSET_8859 == 88597 -#define ISO_8859 7 -#elif LDAP_CHARSET_8859 == 88598 -#define ISO_8859 8 -#elif LDAP_CHARSET_8859 == 88599 -#define ISO_8859 9 -#elif LDAP_CHARSET_8859 == 885910 -#define ISO_8859 10 -#else -#define ISO_8859 0 -#endif - -/* - * the following ISO_8859 to/afrom T.61 character set translation code is - * based on the code found in Enrique Silvestre Mora's iso-t61.c, found - * as part of this package: - * ftp://pereiii.uji.es/pub/uji-ftp/unix/ldap/iso-t61.translation.tar.Z - * Enrique is now (10/95) at this address: enrique.silvestre@uv.es - * - * changes made by mcs@umich.edu 12 October 1995: - * Change calling conventions of iso8859_t61() and t61_iso8859() to - * match libldap conventions; rename to ldap_8859_to_t61() and - * ldap_t61_to_8859(). - * Change conversion routines to deal with non-zero terminated strings. - * ANSI-ize functions and include prototypes. - */ - -/* iso-t61.c - ISO-T61 translation routines (version: 0.2.1, July-1994) */ -/* - * Copyright (c) 1994 Enrique Silvestre Mora, Universitat Jaume I, Spain. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that this notice is preserved and that due credit is given - * to the Universitat Jaume I. The name of the University - * may not be used to endorse or promote products derived from this - * software without specific prior written permission. This software - * is provided ``as is'' without express or implied warranty. -*/ - - -#include -#include -#include - -/* Character set used: ISO 8859-1, ISO 8859-2, ISO 8859-3, ... */ -/* #define ISO_8859 1 */ - -#ifndef ISO_8859 -# define ISO_8859 0 -#endif - -typedef unsigned char Byte; -typedef struct { Byte a, b; } Couple; - -/* Prototypes without LDAP_P(): - * 'Byte' in definition incompatible with unprototyped declaration. */ -static Byte *c_to_hh ( Byte *o, Byte c ); -static Byte *c_to_cc ( Byte *o, const Couple *cc, Byte c ); -static int hh_to_c ( const Byte *h ); -static Byte *cc_to_t61 ( Byte *o, const Byte *s ); - -/* - Character choosed as base in diacritics alone: NO-BREAK SPACE. - (The standard say it must be a blank space, 0x20.) -*/ -#define ALONE 0xA0 - -static const Couple diacritic[16] = { -#if (ISO_8859 == 1) || (ISO_8859 == 9) - {0,0}, {'`',0}, {0xb4,0}, {'^',0}, - {'~',0}, {0xaf,0}, {'(',ALONE}, {'.',ALONE}, - {0xa8,0}, {0,0}, {'0',ALONE}, {0xb8,0}, - {0,0}, {'"',ALONE}, {';',ALONE}, {'<',ALONE}, -#elif (ISO_8859 == 2) - {0,0}, {'`',0}, {0xb4,0}, {'^',0}, - {'~',0}, {'-',ALONE}, {0xa2,0}, {0xff,0}, - {0xa8,0}, {0,0}, {'0',ALONE}, {0xb8,0}, - {0,0}, {0xbd,0}, {0xb2,0}, {0xb7,0} -#elif (ISO_8859 == 3) - {0,0}, {'`',0}, {0xb4,0}, {'^',0}, - {'~',0}, {'-',ALONE}, {0xa2,0}, {0xff,0}, - {0xa8,0}, {0,0}, {'0',ALONE}, {0xb8,0}, - {0,0}, {'"',ALONE}, {';',ALONE}, {'<',ALONE} -#elif (ISO_8859 == 4) - {0,0}, {'`',0}, {0xb4,0}, {'^',0}, - {'~',0}, {0xaf,0}, {'(',ALONE}, {0xff,0}, - {0xa8,0}, {0,0}, {'0',ALONE}, {0xb8,0}, - {0,0}, {'"',ALONE}, {0xb2,0}, {0xb7,0} -#else - {0,0}, {'`',0}, {'\'',ALONE}, {'^',0}, - {'~',0}, {'-',ALONE}, {'(',ALONE}, {'.',ALONE}, - {':',ALONE}, {0,0}, {'0',ALONE}, {',',ALONE}, - {0,0}, {'"',ALONE}, {';',ALONE}, {'<',ALONE} -#endif -}; - -/* - --- T.61 (T.51) letters with diacritics: conversion to ISO 8859-n ----- - A, C, D, E, G, H, I, J, K, - L, N, O, R, S, T, U, W, Y, Z. - ----------------------------------------------------------------------- -*/ -static const int letter_w_diacritic[16][38] = { -#if (ISO_8859 == 1) - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0xc0,0, 0, 0xc8,0, 0, 0xcc,0, 0, - 0, 0, 0xd2,0, 0, 0, 0xd9,0, 0, 0, - 0xe0,0, 0, 0xe8,0, 0, 0xec,0, 0, - 0, 0, 0xf2,0, 0, 0, 0xf9,0, 0, 0, - 0xc1,-1, 0, 0xc9,0, 0, 0xcd,0, 0, - -1, -1, 0xd3,-1, -1, 0, 0xda,0, 0xdd,-1, - 0xe1,-1, 0, 0xe9,0, 0, 0xed,0, 0, - -1, -1, 0xf3,-1, -1, 0, 0xfa,0, 0xfd,-1, - 0xc2,-1, 0, 0xca,-1, -1, 0xce,-1, 0, - 0, 0, 0xd4,0, -1, 0, 0xdb,-1, -1, 0, - 0xe2,-1, 0, 0xea,-1, -1, 0xee,-1, 0, - 0, 0, 0xf4,0, -1, 0, 0xfb,-1, -1, 0, - 0xc3,0, 0, 0, 0, 0, -1, 0, 0, - 0, 0xd1,0xd5,0, 0, 0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0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, - -1, 0, 0, -1, 0, 0, -1, 0, 0, - 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, - -1, 0, 0, -1, 0, 0, -1, 0, 0, - 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, - 0, -1, -1, -1, 0, 0, 0, 0, 0, - -1, -1, 0, -1, -1, -1, 0, 0, 0, -1, - 0, -1, -1, -1, 0, 0, 0, 0, 0, - -1, -1, 0, -1, -1, -1, 0, 0, 0, -1 -#elif (ISO_8859 == 2) - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - -1, 0, 0, -1, 0, 0, -1, 0, 0, - 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, - -1, 0, 0, -1, 0, 0, -1, 0, 0, - 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, - 0xc1,0xc6,0, 0xc9,0, 0, 0xcd,0, 0, - 0xc5,0xd1,0xd3,0xc0,0xa6,0, 0xda,0, 0xdd,0xac, - 0xe1,0xe6,0, 0xe9,0, 0, 0xed,0, 0, - 0xe5,0xf1,0xf3,0xe0,0xb6,0, 0xfa,0, 0xfd,0xbc, - 0xc2,-1, 0, -1, -1, -1, 0xce,-1, 0, - 0, 0, 0xd4,0, -1, 0, -1, -1, -1, 0, - 0xe2,-1, 0, -1, -1, -1, 0xee,-1, 0, - 0, 0, 0xf4,0, -1, 0, -1, -1, -1, 0, - -1, 0, 0, 0, 0, 0, -1, 0, 0, - 0, -1, -1, 0, 0, 0, -1, 0, 0, 0, - -1, 0, 0, 0, 0, 0, -1, 0, 0, - 0, -1, -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0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, - -1, 0, 0, -1, 0, 0, -1, 0, 0, - 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, - -1, 0, 0, -1, 0, 0, -1, 0, 0, - 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, - 0, -1, -1, -1, 0, 0, 0, 0, 0, - -1, -1, 0, -1, -1, -1, 0, 0, 0, -1, - 0, -1, -1, -1, 0, 0, 0, 0, 0, - -1, -1, 0, -1, -1, -1, 0, 0, 0, -1 -#elif (ISO_8859 == 4) - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - -1, 0, 0, -1, 0, 0, -1, 0, 0, - 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, - -1, 0, 0, -1, 0, 0, -1, 0, 0, - 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, - 0xc1,-1, 0, 0xc9,0, 0, 0xcd,0, 0, - -1, -1, -1, -1, -1, 0, 0xda,0, -1, -1, - 0xe1,-1, 0, 0xe9,0, 0, 0xed,0, 0, - -1, -1, -1, -1, -1, 0, 0xfa,0, -1, -1, - 0xc2,-1, 0, -1, -1, -1, 0xce,-1, 0, - 0, 0, 0xd4,0, -1, 0, 0xdb,-1, -1, 0, - 0xe2,-1, 0, -1, -1, -1, 0xee,-1, 0, - 0, 0, 0xf4,0, -1, 0, 0xfb,-1, -1, 0, - 0xc3,0, 0, 0, 0, 0, 0xa5,0, 0, - 0, -1, 0xd5,0, 0, 0, 0xdd,0, 0, 0, - 0xe3,0, 0, 0, 0, 0, 0xb5,0, 0, - 0, -1, 0xf5,0, 0, 0, 0xfd,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0, 0, 0, - 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, - 0xa1,0, 0, 0xca,0, 0, 0xc7,0, 0, - 0, 0, 0, 0, 0, 0, 0xd9,0, 0, 0, - 0xb1,0, 0, 0xea,0, 0, 0xe7,0, 0, - 0, 0, 0, 0, 0, 0, 0xf9,0, 0, 0, - 0, 0xc8,-1, -1, 0, 0, 0, 0, 0, - -1, -1, 0, -1, 0xaa,-1, 0, 0, 0, 0xac, - 0, 0xe8,-1, -1, 0, 0, 0, 0, 0, - -1, -1, 0, -1, 0xba,-1, 0, 0, 0, 0xbc -#else - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - -1, 0, 0, -1, 0, 0, -1, 0, 0, - 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, - -1, 0, 0, -1, 0, 0, -1, 0, 0, - 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, - -1, -1, 0, -1, 0, 0, -1, 0, 0, - -1, -1, -1, -1, -1, 0, -1, 0, -1, -1, - -1, -1, 0, -1, 0, 0, -1, 0, 0, - -1, -1, -1, -1, -1, 0, -1, 0, -1, -1, - -1, -1, 0, -1, -1, -1, -1, -1, 0, - 0, 0, -1, 0, -1, 0, -1, -1, -1, 0, - -1, -1, 0, -1, -1, -1, -1, -1, 0, - 0, 0, -1, 0, -1, 0, -1, -1, -1, 0, - -1, 0, 0, 0, 0, 0, -1, 0, 0, - 0, -1, -1, 0, 0, 0, -1, 0, 0, 0, - -1, 0, 0, 0, 0, 0, -1, 0, 0, - 0, -1, -1, 0, 0, 0, -1, 0, 0, 0, - -1, 0, 0, -1, 0, 0, -1, 0, 0, - 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, - -1, 0, 0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0, 0, 0, 0, 0, 0, -1, 0, 0, 0, - -1, 0, 0, -1, 0, 0, -1, 0, 0, - 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, - 0, -1, -1, -1, 0, 0, 0, 0, 0, - -1, -1, 0, -1, -1, -1, 0, 0, 0, -1, - 0, -1, -1, -1, 0, 0, 0, 0, 0, - -1, -1, 0, -1, -1, -1, 0, 0, 0, -1 -#endif -}; - -/* ---- T.61 characters [0xA0 .. 0xBF] ----------------- -*/ -static const Couple trans_t61a_iso8859[32] = { -#if (ISO_8859 == 1) || (ISO_8859 == 9) - {'N','S'}, {0xa1,0}, {0xa2,0}, {0xa3,0}, - {'D','O'}, {0xa5,0}, {'C','u'}, {0xa7,0}, - {0xa4,0}, {'\'','6'},{'"','6'}, {0xab,0}, - {'<','-'}, {'-','!'}, {'-','>'}, {'-','v'}, - {0xb0,0}, {0xb1,0}, {0xb2,0}, {0xb3,0}, - {0xd7,0}, {0xb5,0}, {0xb6,0}, {0xb7,0}, - {0xf7,0}, {'\'','9'},{'"','9'}, {0xbb,0}, - {0xbc,0}, {0xbd,0}, {0xbe,0}, {0xbf,0} -#elif (ISO_8859 == 2) || (ISO_8859 == 4) - {'N','S'}, {'!','I'}, {'C','t'}, {'P','d'}, - {'D','O'}, {'Y','e'}, {'C','u'}, {0xa7,0}, - {0xa4,0}, {'\'','6'},{'"','6'}, {'<','<'}, - {'<','-'}, {'-','!'}, {'-','>'}, {'-','v'}, - {0xb0,0}, {'+','-'}, {'2','S'}, {'3','S'}, - {0xd7,0}, {'M','y'}, {'P','I'}, {'.','M'}, - {0xf7,0}, {'\'','9'},{'"','9'}, {'>','>'}, - {'1','4'}, {'1','2'}, {'3','4'}, {'?','I'}, -#elif (ISO_8859 == 3) - {'N','S'}, {'!','I'}, {'C','t'}, {0xa3,0}, - {'D','O'}, {'Y','e'}, {'C','u'}, {0xa7,0}, - {0xa4,0}, {'\'','6'},{'"','6'}, {'<','<'}, - {'<','-'}, {'-','!'}, {'-','>'}, {'-','v'}, - {0xb0,0}, {'+','-'}, {0xb2,0}, {0xb3,0}, - {0xd7,0}, {0xb5,0}, {'P','I'}, {0xb7,0}, - {0xf7,0}, {'\'','9'},{'"','9'}, {'>','>'}, - {'1','4'}, {0xbd,0}, {'3','4'}, {'?','I'} -#elif (ISO_8859 == 10) - {'N','S'}, {'!','I'}, {'C','t'}, {'P','d'}, - {'D','O'}, {'Y','e'}, {'C','u'}, {0xa7,0}, - {'C','u'}, {'\'','6'},{'"','6'}, {'<','<'}, - {'<','-'}, {'-','!'}, {'-','>'}, {'-','v'}, - {0xb0,0}, {'+','-'}, {'2','S'}, {'3','S'}, - {'*','X'}, {'M','y'}, {'P','I'}, {0xb7,0}, - {'-',':'}, {'\'','9'},{'"','9'}, {'>','>'}, - {'1','4'}, {'1','2'}, {'3','4'}, {'?','I'} -#else - {'N','S'}, {'!','I'}, {'C','t'}, {'P','d'}, - {'D','O'}, {'Y','e'}, {'C','u'}, {'S','E'}, - {'X','O'}, {'\'','6'},{'"','6'}, {'<','<'}, - {'<','-'}, {'-','!'}, {'-','>'}, {'-','v'}, - {'D','G'}, {'+','-'}, {'2','S'}, {'3','S'}, - {'*','X'}, {'M','y'}, {'P','I'}, {'.','M'}, - {'-',':'}, {'\'','9'},{'"','9'}, {'>','>'}, - {'1','4'}, {'1','2'}, {'3','4'}, {'?','I'} -#endif -}; - -/* ---- T.61 characters [0xE0 .. 0xFF] ----------------- -*/ -static const Couple trans_t61b_iso8859[48] = { -#if (ISO_8859 == 1) - {'-','M'}, {0xb9,0}, {0xae,0}, {0xa9,0}, - {'T','M'}, {'M','8'}, {0xac,0}, {0xa6,0}, - {0,0}, {0,0}, {0,0}, {0,0}, - {'1','8'}, {'3','8'}, {'5','8'}, {'7','8'}, - {'O','m'}, {0xc6,0}, {0xd0,0}, {0xaa,0}, - {'H','/'}, {0,0}, {'I','J'}, {'L','.'}, - {'L','/'}, {0xd8,0}, {'O','E'}, {0xba,0}, - {0xde,0}, {'T','/'}, {'N','G'}, {'\'','n'}, - {'k','k'}, {0xe6,0}, {'d','/'}, {0xf0,0}, - {'h','/'}, {'i','.'}, {'i','j'}, {'l','.'}, - {'l','/'}, {0xf8,0}, {'o','e'}, {0xdf,0}, - {0xfe,0}, {'t','/'}, {'n','g'}, {'-','-'} -#elif (ISO_8859 == 2) - {'-','M'}, {'1','S'}, {'R','g'}, {'C','o'}, - {'T','M'}, {'M','8'}, {'N','O'}, {'B','B'}, - {0,0}, {0,0}, {0,0}, {0,0}, - {'1','8'}, {'3','8'}, {'5','8'}, {'7','8'}, - {'O','m'}, {'A','E'}, {0xd0,0}, {'-','a'}, - {'H','/'}, {0,0}, {'I','J'}, {'L','.'}, - {0xa3,0}, {'O','/'}, {'O','E'}, {'-','o'}, - {'T','H'}, {'T','/'}, {'N','G'}, {'\'','n'}, - {'k','k'}, {'a','e'}, {0xf0,0}, {'d','-'}, - {'h','/'}, {'i','.'}, {'i','j'}, {'l','.'}, - {0xb3,0}, {'o','/'}, {'o','e'}, {0xdf,0}, - {'t','h'}, {'t','/'}, {'n','g'}, {'-','-'} -#elif (ISO_8859 == 3) - {'-','M'}, {'1','S'}, {'R','g'}, {'C','o'}, - {'T','M'}, {'M','8'}, {'N','O'}, {'B','B'}, - {0,0}, {0,0}, {0,0}, {0,0}, - {'1','8'}, {'3','8'}, {'5','8'}, {'7','8'}, - {'O','m'}, {'A','E'}, {'D','/'}, {'-','a'}, - {0xa1,0}, {0,0}, {'I','J'}, {'L','.'}, - {'L','/'}, {'O','/'}, {'O','E'}, {'-','o'}, - {'T','H'}, {'T','/'}, {'N','G'}, {'\'','n'}, - {'k','k'}, {'a','e'}, {'d','/'}, {'d','-'}, - {0xb1,0}, {0xb9,0}, {'i','j'}, {'l','.'}, - {'l','/'}, {'o','/'}, {'o','e'}, {0xdf,0}, - {'t','h'}, {'t','/'}, {'n','g'}, {'-','-'} -#elif (ISO_8859 == 4) - {'-','M'}, {'1','S'}, {'R','g'}, {'C','o'}, - {'T','M'}, {'M','8'}, {'N','O'}, {'B','B'}, - {0,0}, {0,0}, {0,0}, {0,0}, - {'1','8'}, {'3','8'}, {'5','8'}, {'7','8'}, - {'O','m'}, {0xc6,0}, {0xd0,0}, {'-','a'}, - {'H','/'}, {0,0}, {'I','J'}, {'L','.'}, - {'L','/'}, {0xd8,0}, {'O','E'}, {'-','o'}, - {'T','H'}, {0xac,0}, {0xbd,0}, {'\'','n'}, - {0xa2,0}, {0xe6,0}, {0xf0,0}, {'d','-'}, - {'h','/'}, {'i','.'}, {'i','j'}, {'l','.'}, - {'l','/'}, {0xf8,0}, {'o','e'}, {0xdf,0}, - {'t','h'}, {0xbc,0}, {0xbf,0}, {'-','-'} -#elif (ISO_8859 == 9) - {'-','M'}, {0xb9,0}, {0xae,0}, {0xa9,0}, - {'T','M'}, {'M','8'}, {0xac,0}, {0xa6,0}, - {0,0}, {0,0}, {0,0}, {0,0}, - {'1','8'}, {'3','8'}, {'5','8'}, {'7','8'}, - {'O','m'}, {0xc6,0}, {'D','/'}, {0xaa,0}, - {'H','/'}, {0,0}, {'I','J'}, {'L','.'}, - {'L','/'}, {0xd8,0}, {'O','E'}, {0xba,0}, - {'T','H'}, {'T','/'}, {'N','G'}, {'\'','n'}, - {'k','k'}, {0xe6,0}, {'d','/'}, {'d','-'}, - {'h','/'}, {0xfd,0}, {'i','j'}, {'l','.'}, - {'l','/'}, {0xf8,0}, {'o','e'}, {0xdf,0}, - {'t','h'}, {'t','/'}, {'n','g'}, {'-','-'} -#elif (ISO_8859 == 10) - {0xbd,0}, {'1','S'}, {'R','g'}, {'C','o'}, - {'T','M'}, {'M','8'}, {'N','O'}, {'B','B'}, - {0,0}, {0,0}, {0,0}, {0,0}, - {'1','8'}, {'3','8'}, {'5','8'}, {'7','8'}, - {'O','m'}, {0xc6,0}, {0xa9,0}, {'-','a'}, - {'H','/'}, {0,0}, {'I','J'}, {'L','.'}, - {'L','/'}, {0xd8,0}, {'O','E'}, {'-','o'}, - {0xde,0}, {0xab,0}, {0xaf,0}, {'\'','n'}, - {0xff,0}, {0xe6,0}, {0xb9,0}, {0xf0,0}, - {'h','/'}, {'i','.'}, {'i','j'}, {'l','.'}, - {'l','/'}, {0xf8,0}, {'o','e'}, {0xdf,0}, - {0xfe,0}, {0xbb,0}, {0xbf,0}, {'-','-'} -#else - {'-','M'}, {'1','S'}, {'R','g'}, {'C','o'}, - {'T','M'}, {'M','8'}, {'N','O'}, {'B','B'}, - {0,0}, {0,0}, {0,0}, {0,0}, - {'1','8'}, {'3','8'}, {'5','8'}, {'7','8'}, - {'O','m'}, {'A','E'}, {'D','/'}, {'-','a'}, - {'H','/'}, {0,0}, {'I','J'}, {'L','.'}, - {'L','/'}, {'O','/'}, {'O','E'}, {'-','o'}, - {'T','H'}, {'T','/'}, {'N','G'}, {'\'','n'}, - {'k','k'}, {'a','e'}, {'d','/'}, {'d','-'}, - {'h','/'}, {'i','.'}, {'i','j'}, {'l','.'}, - {'l','/'}, {'o','/'}, {'o','e'}, {'s','s'}, - {'t','h'}, {'t','-'}, {'n','g'}, {'-','-'} -#endif -}; - -/* ---- ISO 8859-n characters <0xA0 .. 0xFF> ------------------- -*/ -#if (ISO_8859 == 1) -static const Couple trans_iso8859_t61[96] = { - {0xa0,0}, {0xa1,0}, {0xa2,0}, {0xa3,0}, - {0xa8,0}, {0xa5,0}, {0xd7,0}, {0xa7,0}, - {0xc8,ALONE}, {0xd3,0}, {0xe3,0}, {0xab,0}, - {0xd6,0}, {0xff,0}, {0xd2,0}, {0xc5,ALONE}, - {0xb0,0}, {0xb1,0}, {0xb2,0}, {0xb3,0}, - {0xc2,ALONE}, {0xb5,0}, {0xb6,0}, {0xb7,0}, - {0xcb,ALONE}, {0xd1,0}, {0xeb,0}, {0xbb,0}, - {0xbc,0}, {0xbd,0}, {0xbe,0}, {0xbf,0}, - {0xc1,'A'}, {0xc2,'A'}, {0xc3,'A'}, {0xc4,'A'}, - {0xc8,'A'}, {0xca,'A'}, {0xe1,0}, {0xcb,'C'}, - {0xc1,'E'}, {0xc2,'E'}, {0xc3,'E'}, {0xc8,'E'}, - {0xc1,'I'}, {0xc2,'I'}, {0xc3,'I'}, {0xc8,'I'}, - {0xe2,0}, {0xc4,'N'}, {0xc1,'O'}, {0xc2,'O'}, - {0xc3,'O'}, {0xc4,'O'}, {0xc8,'O'}, {0xb4,0}, - {0xe9,0}, {0xc1,'U'}, {0xc2,'U'}, {0xc3,'U'}, - {0xc8,'U'}, {0xc2,'Y'}, {0xec,0}, {0xfb,0}, - {0xc1,'a'}, {0xc2,'a'}, {0xc3,'a'}, {0xc4,'a'}, - {0xc8,'a'}, {0xca,'a'}, {0xf1,0}, {0xcb,'c'}, - {0xc1,'e'}, {0xc2,'e'}, {0xc3,'e'}, {0xc8,'e'}, - {0xc1,'i'}, {0xc2,'i'}, {0xc3,'i'}, {0xc8,'i'}, - {0xf3,0}, {0xc4,'n'}, {0xc1,'o'}, {0xc2,'o'}, - {0xc3,'o'}, {0xc4,'o'}, {0xc8,'o'}, {0xb8,0}, - {0xf9,0}, {0xc1,'u'}, {0xc2,'u'}, {0xc3,'u'}, - {0xc8,'u'}, {0xc2,'y'}, {0xfc,0}, {0xc8,'y'} -}; -#elif (ISO_8859 == 2) -static const Couple trans_iso8859_t61[96] = { - {0xa0,0}, {0xce,'A'}, {0xc6,ALONE}, {0xe8,0}, - {0xa8,0}, {0xcf,'L'}, {0xc2,'S'}, {0xa7,0}, - {0xc8,ALONE}, {0xcf,'S'}, {0xcb,'S'}, {0xcf,'T'}, - {0xc2,'Z'}, {0xff,0}, {0xcf,'Z'}, {0xc7,'Z'}, - {0xb0,0}, {0xce,'a'}, {0xce,ALONE}, {0xf8,0}, - {0xc2,ALONE}, {0xcf,'l'}, {0xc2,'s'}, {0xcf,ALONE}, - {0xcb,ALONE}, {0xcf,'s'}, {0xcb,'s'}, {0xcf,'t'}, - {0xc2,'z'}, {0xcd,ALONE}, {0xcf,'z'}, {0xc7,'z'}, - {0xc2,'R'}, {0xc2,'A'}, {0xc3,'A'}, {0xc6,'A'}, - {0xc8,'A'}, {0xc2,'L'}, {0xc2,'C'}, {0xcb,'C'}, - {0xcf,'C'}, {0xc2,'E'}, {0xce,'E'}, {0xc8,'E'}, - {0xcf,'E'}, {0xc2,'I'}, {0xc3,'I'}, {0xcf,'D'}, - {0xe2,0}, {0xc2,'N'}, {0xcf,'N'}, {0xc2,'O'}, - {0xc3,'O'}, {0xcd,'O'}, {0xc8,'O'}, {0xb4,0}, - {0xcf,'R'}, {0xca,'U'}, {0xc2,'U'}, {0xcd,'U'}, - {0xc8,'U'}, {0xc2,'Y'}, {0xcb,'T'}, {0xfb,0}, - {0xc2,'r'}, {0xc2,'a'}, {0xc3,'a'}, {0xc6,'a'}, - {0xc8,'a'}, {0xc2,'l'}, {0xc2,'c'}, {0xcb,'c'}, - {0xcf,'c'}, {0xc2,'e'}, {0xce,'e'}, {0xc8,'e'}, - {0xcf,'e'}, {0xc2,'i'}, {0xc3,'i'}, {0xcf,'d'}, - {0xf2,0}, {0xc2,'n'}, {0xcf,'n'}, {0xc2,'o'}, - {0xc3,'o'}, {0xcd,'o'}, {0xc8,'o'}, {0xb8,0}, - {0xcf,'r'}, {0xca,'u'}, {0xc2,'u'}, {0xcd,'u'}, - {0xc8,'u'}, {0xc2,'y'}, {0xcb,'t'}, {0xc7,ALONE} -}; -#elif (ISO_8859 == 3) -static const Couple trans_iso8859_t61[96] = { - {0xa0,0}, {0xe4,0}, {0xc6,ALONE}, {0xa3,0}, - {0xa8,0}, {0,0}, {0xc3,'H'}, {0xa7,0}, - {0xc8,ALONE}, {0xc7,'I'}, {0xcb,'S'}, {0xc6,'G'}, - {0xc3,'J'}, {0xff,0}, {0,0}, {0xc7,'Z'}, - {0xb0,0}, {0xf4,0}, {0xb2,0}, {0xb3,0}, - {0xc2,ALONE}, {0xb5,0}, {0xc3,'h'}, {0xb7,0}, - {0xcb,ALONE}, {0xf5,0}, {0xcb,'s'}, {0xc6,'g'}, - {0xc3,'j'}, {0xbd,0}, {0,0}, {0xc7,'z'}, - {0xc1,'A'}, {0xc2,'A'}, {0xc3,'A'}, {0,0}, - {0xc8,'A'}, {0xc7,'C'}, {0xc3,'C'}, {0xcb,'C'}, - {0xc1,'E'}, {0xc2,'E'}, {0xc3,'E'}, {0xc8,'E'}, - {0xc1,'I'}, {0xc2,'I'}, {0xc3,'I'}, {0xc8,'I'}, - {0,0}, {0xc4,'N'}, {0xc1,'O'}, {0xc2,'O'}, - {0xc3,'O'}, {0xc7,'G'}, {0xc8,'O'}, {0xb4,0}, - {0xc3,'G'}, {0xc1,'U'}, {0xc2,'U'}, {0xc3,'U'}, - {0xc8,'U'}, {0xc6,'U'}, {0xc3,'S'}, {0xfb,0}, - {0xc1,'a'}, {0xc2,'a'}, {0xc3,'a'}, {0,0}, - {0xc8,'a'}, {0xc7,'c'}, {0xc3,'c'}, {0xcb,'c'}, - {0xc1,'e'}, {0xc2,'e'}, {0xc3,'e'}, {0xc8,'e'}, - {0xc1,'i'}, {0xc2,'i'}, {0xc3,'i'}, {0xc8,'i'}, - {0,0}, {0xc4,'n'}, {0xc1,'o'}, {0xc2,'o'}, - {0xc3,'o'}, {0xc7,'g'}, {0xc8,'o'}, {0xb8,0}, - {0xc3,'g'}, {0xc1,'u'}, {0xc2,'u'}, {0xc3,'u'}, - {0xc8,'u'}, {0xc6,'u'}, {0xc3,'s'}, {0xc7,ALONE} -}; -#elif (ISO_8859 == 4) -static const Couple trans_iso8859_t61[96] = { - {0xa0,0}, {0xce,'A'}, {0xf0,0}, {0xcb,'R'}, - {0xa8,0}, {0xc4,'I'}, {0xcb,'L'}, {0xa7,0}, - {0xc8,ALONE}, {0xcf,'S'}, {0xc5,'E'}, {0xcb,'G'}, - {0xed,0}, {0xff,0}, {0xcf,'Z'}, {0xc5,ALONE}, - {0xb0,0}, {0xce,'a'}, {0xce,ALONE}, {0xcb,'r'}, - {0xc2,ALONE}, {0xc4,'i'}, {0xcb,'l'}, {0xcf,ALONE}, - {0xcb,ALONE}, {0xcf,'s'}, {0xc5,'e'}, {0xcb,'g'}, - {0xfd,0}, {0xee,0}, {0xcf,'z'}, {0xfe,0}, - {0xc5,'A'}, {0xc2,'A'}, {0xc3,'A'}, {0xc4,'A'}, - {0xc8,'A'}, {0xca,'A'}, {0xe1,0}, {0xce,'I'}, - {0xcf,'C'}, {0xc2,'E'}, {0xce,'E'}, {0xc8,'E'}, - {0xc7,'E'}, {0xc2,'I'}, {0xc3,'I'}, {0xc5,'I'}, - {0xe2,0}, {0xcb,'N'}, {0xc5,'O'}, {0xcb,'K'}, - {0xc3,'O'}, {0xc4,'O'}, {0xc8,'O'}, {0xb4,0}, - {0xe9,0}, {0xce,'U'}, {0xc2,'U'}, {0xc3,'U'}, - {0xc8,'U'}, {0xc4,'U'}, {0xc5,'U'}, {0xfb,0}, - {0xc5,'a'}, {0xc2,'a'}, {0xc3,'a'}, {0xc4,'a'}, - {0xc8,'a'}, {0xca,'a'}, {0xf1,0}, {0xce,'i'}, - {0xcf,'c'}, {0xc2,'e'}, {0xce,'e'}, {0xc8,'e'}, - {0xc7,'e'}, {0xc2,'i'}, {0xc3,'i'}, {0xc5,'i'}, - {0xf2,0}, {0xcb,'n'}, {0xc5,'o'}, {0xcb,'k'}, - {0xc3,'o'}, {0xc4,'o'}, {0xc8,'o'}, {0xb8,0}, - {0xf9,0}, {0xce,'u'}, {0xc2,'u'}, {0xc3,'u'}, - {0xc8,'u'}, {0xc4,'u'}, {0xc5,'u'}, {0xc7,ALONE} -}; -#elif (ISO_8859 == 9) -static const Couple trans_iso8859_t61[96] = { - {0xa0,0}, {0xa1,0}, {0xa2,0}, {0xa3,0}, - {0xa8,0}, {0xa5,0}, {0xd7,0}, {0xa7,0}, - {0xc8,ALONE}, {0xd3,0}, {0xe3,0}, {0xab,0}, - {0xd6,0}, {0xff,0}, {0xd2,0}, {0xc5,ALONE}, - {0xb0,0}, {0xb1,0}, {0xb2,0}, {0xb3,0}, - {0xc2,ALONE}, {0xb5,0}, {0xb6,0}, {0xb7,0}, - {0xcb,ALONE}, {0xd1,0}, {0xeb,0}, {0xbb,0}, - {0xbc,0}, {0xbd,0}, {0xbe,0}, {0xbf,0}, - {0xc1,'A'}, {0xc2,'A'}, {0xc3,'A'}, {0xc4,'A'}, - {0xc8,'A'}, {0xca,'A'}, {0xe1,0}, {0xcb,'C'}, - {0xc1,'E'}, {0xc2,'E'}, {0xc3,'E'}, {0xc8,'E'}, - {0xc1,'I'}, {0xc2,'I'}, {0xc3,'I'}, {0xc8,'I'}, - {0xc6,'G'}, {0xc4,'N'}, {0xc1,'O'}, {0xc2,'O'}, - {0xc3,'O'}, {0xc4,'O'}, {0xc8,'O'}, {0xb4,0}, - {0xe9,0}, {0xc1,'U'}, {0xc2,'U'}, {0xc3,'U'}, - {0xc8,'U'}, {0xc7,'I'}, {0xcb,'S'}, {0xfb,0}, - {0xc1,'a'}, {0xc2,'a'}, {0xc3,'a'}, {0xc4,'a'}, - {0xc8,'a'}, {0xca,'a'}, {0xf1,0}, {0xcb,'c'}, - {0xc1,'e'}, {0xc2,'e'}, {0xce,'e'}, {0xc8,'e'}, - {0xc7,'e'}, {0xc2,'i'}, {0xc3,'i'}, {0xc5,'i'}, - {0xc6,'g'}, {0xc4,'n'}, {0xc1,'o'}, {0xc2,'o'}, - {0xc3,'o'}, {0xc4,'o'}, {0xc8,'o'}, {0xb8,0}, - {0xf9,0}, {0xc1,'u'}, {0xc2,'u'}, {0xc3,'u'}, - {0xc8,'u'}, {0xf5,0}, {0xcb,'s'}, {0xc8,'y'} -}; -#elif (ISO_8859 == 10) -static const Couple trans_iso8859_t61[96] = { - {0xa0,0}, {0xce,'A'}, {0xc5,'E'}, {0xcb,'G'}, - {0xc5,'I'}, {0xc4,'I'}, {0xcb,'K'}, {0xa7,0}, - {0xcb,'L'}, {0xe2,0}, {0xcf,'S'}, {0xed,0}, - {0xcf,'Z'}, {0xff,0}, {0xc5,'U'}, {0xee,0}, - {0xb0,0}, {0xce,'a'}, {0xc5,'e'}, {0xcb,'g'}, - {0xc5,'i'}, {0xc4,'i'}, {0xcb,'k'}, {0xb7,0}, - {0xcb,'l'}, {0xf2,0}, {0xcf,'s'}, {0xfd,0}, - {0xcf,'z'}, {0xd0,0}, {0xc5,'u'}, {0xfe,0}, - {0xc5,'A'}, {0xc2,'A'}, {0xc3,'A'}, {0xc4,'A'}, - {0xc8,'A'}, {0xca,'A'}, {0xe1,0}, {0xce,'I'}, - {0xcf,'C'}, {0xc2,'E'}, {0xce,'E'}, {0xc8,'E'}, - {0xc7,'E'}, {0xc2,'I'}, {0xc3,'I'}, {0xc8,'I'}, - {0,0}, {0xcb,'N'}, {0xc5,'O'}, {0xc2,'O'}, - {0xc3,'O'}, {0xc4,'O'}, {0xc8,'O'}, {0xc4,'U'}, - {0xe9,0}, {0xce,'U'}, {0xc2,'U'}, {0xc3,'U'}, - {0xc8,'U'}, {0xc2,'Y'}, {0xec,0}, {0xfb,0}, - {0xc5,'a'}, {0xc2,'a'}, {0xc3,'a'}, {0xc4,'a'}, - {0xc8,'a'}, {0xca,'a'}, {0xf1,0}, {0xce,'i'}, - {0xcf,'c'}, {0xc2,'e'}, {0xce,'e'}, {0xc8,'e'}, - {0xc7,'e'}, {0xc2,'i'}, {0xc3,'i'}, {0xc8,'i'}, - {0xf3,0}, {0xcb,'n'}, {0xc5,'o'}, {0xc2,'o'}, - {0xc3,'o'}, {0xc4,'o'}, {0xc8,'o'}, {0xc4,'u'}, - {0xf9,0}, {0xce,'u'}, {0xc2,'u'}, {0xc3,'u'}, - {0xc8,'u'}, {0xc2,'y'}, {0xfc,0}, {0xf0,0} -}; -#endif - - -static Byte * -c_to_hh( Byte *o, Byte c ) -{ - Byte n; - - *o++ = '{'; *o++ = 'x'; - n = c >> 4; - *o++ = ((n < 0xA) ? '0' : 'A' - 0xA) + n; - n = c & 0x0F; - *o++ = ((n < 0xA) ? '0' : 'A' - 0xA) + n; - *o++ = '}'; - return o; -} - - -static Byte * -c_to_cc( Byte *o, const Couple *cc, Byte c ) -{ - if ( (*cc).a != 0 ) { - if ( (*cc).b == 0 ) - *o++ = (*cc).a; - else { - *o++ = '{'; - *o++ = (*cc).a; - *o++ = (*cc).b; - *o++ = '}'; - } - return o; - } - else - return c_to_hh( o, c ); -} - -/* --- routine to convert from T.61 to ISO 8859-n --- */ - -int -ldap_t61_to_8859( char **bufp, ber_len_t *buflenp, int free_input ) -{ - Byte *s, *oo, *o; - unsigned int n; - int c; - ber_len_t len; - - Debug( LDAP_DEBUG_TRACE, "ldap_t61_to_8859 input length: %ld\n", - *buflenp, 0, 0 ); - - len = *buflenp; - s = (Byte *) *bufp; - - if ( (o = oo = (Byte *)LDAP_MALLOC( 2 * len + 64 )) == NULL ) { - return( 1 ); - } - - while ( (char *)s - *(char **)bufp < len ) { - switch ( *s >> 4 ) { - - case 0xA: case 0xB: - o = c_to_cc( o, &trans_t61a_iso8859[ *s - 0xA0 ], *s ); - s++; - break; - - case 0xD: case 0xE: case 0xF: - o = c_to_cc( o, &trans_t61b_iso8859[ *s - 0xD0 ], *s ); - s++; - break; - - case 0xC: - if ( (*s == 0xC0) || (*s == 0xC9) || (*s == 0xCC) ) { - o = c_to_hh( o, *s++ ); - break; - } - - n = (*s++) - 0xC0; - switch ( *s ) { - - case 'A': c = letter_w_diacritic[n][0]; break; - case 'C': c = letter_w_diacritic[n][1]; break; - case 'D': c = letter_w_diacritic[n][2]; break; - case 'E': c = letter_w_diacritic[n][3]; break; - case 'G': c = letter_w_diacritic[n][4]; break; - case 'H': c = letter_w_diacritic[n][5]; break; - case 'I': c = letter_w_diacritic[n][6]; break; - case 'J': c = letter_w_diacritic[n][7]; break; - case 'K': c = letter_w_diacritic[n][8]; break; - case 'L': c = letter_w_diacritic[n][9]; break; - case 'N': c = letter_w_diacritic[n][10]; break; - case 'O': c = letter_w_diacritic[n][11]; break; - case 'R': c = letter_w_diacritic[n][12]; break; - case 'S': c = letter_w_diacritic[n][13]; break; - case 'T': c = letter_w_diacritic[n][14]; break; - case 'U': c = letter_w_diacritic[n][15]; break; - case 'W': c = letter_w_diacritic[n][16]; break; - case 'Y': c = letter_w_diacritic[n][17]; break; - case 'Z': c = letter_w_diacritic[n][18]; break; - - case 'a': c = letter_w_diacritic[n][19]; break; - case 'c': c = letter_w_diacritic[n][20]; break; - case 'd': c = letter_w_diacritic[n][21]; break; - case 'e': c = letter_w_diacritic[n][22]; break; - case 'g': c = letter_w_diacritic[n][23]; break; - case 'h': c = letter_w_diacritic[n][24]; break; - case 'i': c = letter_w_diacritic[n][25]; break; - case 'j': c = letter_w_diacritic[n][26]; break; - case 'k': c = letter_w_diacritic[n][27]; break; - case 'l': c = letter_w_diacritic[n][28]; break; - case 'n': c = letter_w_diacritic[n][29]; break; - case 'o': c = letter_w_diacritic[n][30]; break; - case 'r': c = letter_w_diacritic[n][31]; break; - case 's': c = letter_w_diacritic[n][32]; break; - case 't': c = letter_w_diacritic[n][33]; break; - case 'u': c = letter_w_diacritic[n][34]; break; - case 'w': c = letter_w_diacritic[n][35]; break; - case 'y': c = letter_w_diacritic[n][36]; break; - case 'z': c = letter_w_diacritic[n][37]; break; - - case ALONE: c = (( !diacritic[n].b ) ? diacritic[n].a : -1); - break; - - default: c = 0; - } - - if ( c > 0 ) { - *o++ = c; s++; - } else { - *o++ = '{'; - if ( c == -1 ) { - *o++ = ( ( *s == ALONE ) ? ' ' : *s ); - s++; - } else { - *o++ = '"'; - } - *o++ = diacritic[n].a; - *o++ = '}'; - } - break; - -#if (ISO_8859 == 0) - case 0x8: case 0x9: - *o++ = 0x1B; /* */ - *o++ = *s++ - 0x40; - break; -#endif - - default: - *o++ = *s++; - } - } - - len = o - oo; - o = oo; - - if ( (oo = (Byte *)LDAP_REALLOC( o, len )) == NULL ) { - LDAP_FREE( o ); - return( 1 ); - } - - if ( free_input ) { - LDAP_FREE( *bufp ); - } - *bufp = (char *) oo; - *buflenp = len; - return( 0 ); -} - - -static int -hh_to_c( const Byte *h ) -{ - Byte c; - - if ( (*h >= '0') && (*h <= '9') ) c = *h++ - '0'; - else if ( (*h >= 'A') && (*h <= 'F') ) c = *h++ - 'A' + 10; - else if ( (*h >= 'a') && (*h <= 'f') ) c = *h++ - 'a' + 10; - else return -1; - - c <<= 4; - - if ( (*h >= '0') && (*h <= '9') ) c |= *h - '0'; - else if ( (*h >= 'A') && (*h <= 'F') ) c |= *h - 'A' + 10; - else if ( (*h >= 'a') && (*h <= 'f') ) c |= *h - 'a' + 10; - else return -1; - - return c; -} - - -static Byte * -cc_to_t61( Byte *o, const Byte *s ) -{ - int n, c = 0; - - switch ( *(s + 1) ) { - - case '`': c = -1; break; /* */ - - case '!': - switch ( *s ) { - case '!': c = 0x7C; break; /* */ - case '(': c = 0x7B; break; /* */ - case '-': c = 0xAD; break; /* */ - default: c = -1; /* */ - } - break; - -#if (ISO_8859 == 1) || (ISO_8859 == 2) || (ISO_8859 == 3) || \ - (ISO_8859 == 4) || (ISO_8859 == 9) - case 0xB4: -#endif - case '\'': c = -2; break; /* */ - - case '^': c = -3; break; /* */ - - case '>': - switch ( *s ) { - case ')': c = 0x5D; break; /* */ - case '>': c = 0xBB; break; /* */ - case '-': c = 0xAE; break; /* */ - default: c = -3; /* */ - } - break; - - case '~': - case '?': c = -4; break; /* */ - -#if (ISO_8859 == 1) || (ISO_8859 == 4) || (ISO_8859 == 9) - case 0xAF: c = -5; break; /* */ -#endif - - case '-': - switch ( *s ) { - case '-': c = 0xFF; break; /* */ - case '<': c = 0xAC; break; /* */ - case '+': c = 0xB1; break; /* */ - case 'd': c = 0xF3; break; /* */ - default: c = -5; /* */ - } - break; - -#if (ISO_8859 == 2) || (ISO_8859 == 3) - case 0xA2: c = -6; break; /* */ -#endif - - case '(': - if ( *s == '<' ) c = 0x5B; /* */ - else c = -6; /* */ - break; - -#if (ISO_8859 == 2) || (ISO_8859 == 3) || (ISO_8859 == 4) - case 0xFF: c = -7; break; /* */ -#endif - - case '.': - switch ( *s ) { - case 'i': c = 0xF5; break; /* */ - case 'L': c = 0xE7; break; /* */ - case 'l': c = 0xF7; break; /* */ - default: c = -7; /* */ - } - break; - -#if (ISO_8859 == 1) || (ISO_8859 == 2) || (ISO_8859 == 3) || \ - (ISO_8859 == 4) || (ISO_8859 == 9) - case 0xA8: c = -8; break; /* */ -#endif - - case ':': - if ( *s == '-') c = 0xB8; /* */ - else c = -8; /* */ - break; - -#if (ISO_8859 == 1) || (ISO_8859 == 2) || (ISO_8859 == 3) || \ - (ISO_8859 == 4) || (ISO_8859 == 9) || (ISO_8859 == 10) - case 0xB0: -#endif - case '0': c = -10; break; /* */ - -#if (ISO_8859 == 1) || (ISO_8859 == 2) || (ISO_8859 == 3) || \ - (ISO_8859 == 4) || (ISO_8859 == 9) - case 0xB8: -#endif - case ',': c = -11; break; /* */ - -#if (ISO_8859 == 2) - case 0xBD: -#endif - case '"': c = -13; break; /* */ - -#if (ISO_8859 == 2) || (ISO_8859 == 4) - case 0xB2: -#endif - case ';': c = -14; break; /* */ - -#if (ISO_8859 == 2) || (ISO_8859 == 4) - case 0xB7: c = -15; break; /* */ -#endif - - case ')': - if ( *s == '!' ) c = 0x7D; /* */ - break; - - case '<': - if ( *s == '<' ) c = 0xAB; /* */ - else c = -15; /* */ - break; - - case '/': - switch ( *s ) { - case '/': c = 0x5C; break; /* */ - case 'D': c = 0xE2; break; /* */ - case 'd': c = 0xF2; break; /* */ - case 'H': c = 0xE4; break; /* */ - case 'h': c = 0xF4; break; /* */ - case 'L': c = 0xE8; break; /* */ - case 'l': c = 0xF8; break; /* */ - case 'O': c = 0xE9; break; /* */ - case 'o': c = 0xF9; break; /* */ - case 'T': c = 0xED; break; /* */ - case 't': c = 0xFD; break; /* */ - } - break; - - case '2': - if ( *s == '1' ) c = 0xBD; /* */ - break; - - case '4': - switch ( *s ) { - case '1': c = 0xBC; break; /* */ - case '3': c = 0xBE; break; /* */ - } - break; - - case '6': - switch ( *s ) { - case '\'': c = 0xA9; break; /* */ - case '"': c = 0xAA; break; /* */ - } - break; - - case '8': - switch ( *s ) { - case '1': c = 0xDC; break; /* */ - case '3': c = 0xDD; break; /* */ - case '5': c = 0xDE; break; /* */ - case '7': c = 0xDF; break; /* */ - case 'M': c = 0xD5; break; /* */ - } - break; - - case '9': - switch ( *s ) { - case '\'': c = 0xB9; break; /* */ - case '"': c = 0xBA; break; /* */ - } - break; - - case 'A': - if ( *s == 'A' ) c = -10; /* + */ - break; - - case 'a': - switch ( *s ) { - case '-': c = 0xE3; break; /* */ - case 'a': c = -10; break; /* + */ - } - break; - - case 'B': - if ( *s == 'B' ) c = 0xD7; /* */ - break; - - case 'b': - if ( *s == 'N' ) c = 0xA6; /* */ - break; - - case 'd': - if ( *s == 'P' ) c = 0xA3; /* */ - break; - - case 'E': - switch ( *s ) { - case 'S': c = 0xA7; break; /* */ - case 'A': c = 0xE1; break; /* */ - case 'O': c = 0xEA; break; /* */ - } - break; - - case 'e': - switch ( *s ) { - case 'a': c = 0xF1; break; /* */ - case 'o': c = 0xFA; break; /* */ - case 'Y': c = 0xA5; break; /* */ - } - break; - - case 'G': - switch ( *s ) { - case 'D': c = 0xB0; break; /* */ - case 'N': c = 0xEE; break; /* */ - } - break; - - case 'g': - switch ( *s ) { - case 'R': c = 0xD2; break; /* */ - case 'n': c = 0xFE; break; /* */ - } - break; - - case 'H': - if ( *s == 'T' ) c = 0xEC; /* */ - break; - - case 'h': - if ( *s == 't' ) c = 0xFC; /* */ - break; - - case 'I': - switch ( *s ) { - case 'P': c = 0xB6; break; /* */ - case '!': c = 0xA1; break; /* */ - case '?': c = 0xBF; break; /* */ - } - break; - - case 'J': - if ( *s == 'I' ) c = 0xE6; /* */ - break; - - case 'j': - if ( *s == 'i' ) c = 0xF6; /* */ - break; - - case 'k': - if ( *s == 'k' ) c = 0xF0; /* */ - break; - - case 'M': - switch ( *s ) { - case '.': c = 0xB7; break; /* */ - case '-': c = 0xD0; break; /* */ - case 'T': c = 0xD4; break; /* */ - } - break; - - case 'm': - switch ( *s ) { - case '\'': /* RFC 1345 */ - case ' ': c = -5; break; /* */ - case 'O': c = 0xE0; break; /* */ - } - break; - - case 'n': - if ( *s == '\'' ) c = 0xEF; /* */ - break; - - case 'O': - switch ( *s ) { - case 'D': c = 0xA4; break; /* */ - case 'N': c = 0xD6; break; /* */ - } - break; - - case 'o': - switch ( *s ) { - case 'C': c = 0xD3; break; /* */ - case '-': c = 0xEB; break; /* */ - } - break; - - case 'S': - switch ( *s ) { - case '1': c = 0xD1; break; /* */ - case '2': c = 0xB2; break; /* */ - case '3': c = 0xB3; break; /* */ - case 'N': c = 0xA0; break; /* */ - } - break; - - case 's': - if ( *s == 's' ) c = 0xFB; /* */ - break; - - case 't': - if ( *s == 'C' ) c = 0xA2; /* */ - break; - - case 'u': - if ( *s == 'C' ) c = 0xA8; /* */ - break; - - case 'v': - if ( *s == '-' ) c = 0xAF; /* */ - break; - - case 'X': - if ( *s == '*' ) c = 0xB4; /* */ - break; - - case 'y': - if ( *s == 'M' ) c = 0xB5; /* */ - break; - } - - if ( c > 0 ) { - *o++ = c; - return o; - } else if ( !c ) - return NULL; - - /* else: c < 0 */ - n = -c; - switch ( *s ) { - - case 'A': c = letter_w_diacritic[n][0]; break; - case 'C': c = letter_w_diacritic[n][1]; break; - case 'D': c = letter_w_diacritic[n][2]; break; - case 'E': c = letter_w_diacritic[n][3]; break; - case 'G': c = letter_w_diacritic[n][4]; break; - case 'H': c = letter_w_diacritic[n][5]; break; - case 'I': c = letter_w_diacritic[n][6]; break; - case 'J': c = letter_w_diacritic[n][7]; break; - case 'K': c = letter_w_diacritic[n][8]; break; - case 'L': c = letter_w_diacritic[n][9]; break; - case 'N': c = letter_w_diacritic[n][10]; break; - case 'O': c = letter_w_diacritic[n][11]; break; - case 'R': c = letter_w_diacritic[n][12]; break; - case 'S': c = letter_w_diacritic[n][13]; break; - case 'T': c = letter_w_diacritic[n][14]; break; - case 'U': c = letter_w_diacritic[n][15]; break; - case 'W': c = letter_w_diacritic[n][16]; break; - case 'Y': c = letter_w_diacritic[n][17]; break; - case 'Z': c = letter_w_diacritic[n][18]; break; - - case 'a': c = letter_w_diacritic[n][19]; break; - case 'c': c = letter_w_diacritic[n][20]; break; - case 'd': c = letter_w_diacritic[n][21]; break; - case 'e': c = letter_w_diacritic[n][22]; break; - case 'g': c = letter_w_diacritic[n][23]; break; - case 'h': c = letter_w_diacritic[n][24]; break; - case 'i': c = letter_w_diacritic[n][25]; break; - case 'j': c = letter_w_diacritic[n][26]; break; - case 'k': c = letter_w_diacritic[n][27]; break; - case 'l': c = letter_w_diacritic[n][28]; break; - case 'n': c = letter_w_diacritic[n][29]; break; - case 'o': c = letter_w_diacritic[n][30]; break; - case 'r': c = letter_w_diacritic[n][31]; break; - case 's': c = letter_w_diacritic[n][32]; break; - case 't': c = letter_w_diacritic[n][33]; break; - case 'u': c = letter_w_diacritic[n][34]; break; - case 'w': c = letter_w_diacritic[n][35]; break; - case 'y': c = letter_w_diacritic[n][36]; break; - case 'z': c = letter_w_diacritic[n][37]; break; - - case '\'': - case ' ': c = -1; break; - - default: c = 0; - } - - if ( !c ) - return NULL; - - *o++ = n + 0xC0; - *o++ = ( ( (*s == ' ') || (*s == '\'') ) ? ALONE : *s ); - return o; -} - - -/* --- routine to convert from ISO 8859-n to T.61 --- */ - -int -ldap_8859_to_t61( char **bufp, ber_len_t *buflenp, int free_input ) -{ - Byte *s, *oo, *o, *aux; - int c; - ber_len_t len; - const Couple *cc; - - Debug( LDAP_DEBUG_TRACE, "ldap_8859_to_t61 input length: %ld\n", - *buflenp, 0, 0 ); - - len = *buflenp; - s = (Byte *) *bufp; - - if ( (o = oo = (Byte *)LDAP_MALLOC( 2 * len + 64 )) == NULL ) { - return( 1 ); - } - - while ( (char *)s - *(char **)bufp < len ) { - switch( *s >> 5 ) { - - case 2: - switch ( *s ) { - - case '^': *o++ = 0xC3; *o++ = ALONE; s++; break; - - case '\\': - s++; - if ( (c = hh_to_c( s )) != -1 ) { - *o++ = c; - s += 2; - } else - *o++ = '\\'; - break; - - default: *o++ = *s++; - } - break; - - case 3: - switch ( *s ) { - - case '`': *o++ = 0xC1; *o++ = ALONE; s++; break; - case '~': *o++ = 0xC4; *o++ = ALONE; s++; break; - - case '{': - s++; - if ( *(s + 2) == '}' ) { - if ( (aux = cc_to_t61( o, s )) != NULL ) { - o = aux; - s += 3; - } else { - *o++ = '{'; - } - } else if ( (*(s + 3) == '}') && ( (*s == 'x') || (*s == 'X') ) && - ( (c = hh_to_c( s + 1 )) != -1 ) ) { - *o++ = c; - s += 4; - } else { - *o++ = '{'; - } - break; - - default: - *o++ = *s++; - } - break; - -#if (ISO_8859 == 0) - case 4: case 5: case 6: case 7: - s++; - break; -#else - case 5: case 6: case 7: -# if (ISO_8859 == 1) || (ISO_8859 == 2) || (ISO_8859 == 3) || \ - (ISO_8859 == 4) || (ISO_8859 == 9) || (ISO_8859 == 10) - if ( (*(cc = &trans_iso8859_t61[ *s - 0xA0 ])).a ) { - *o++ = (*cc).a; - if ( (*cc).b ) *o++ = (*cc).b; - } -# endif - s++; - break; -#endif - - default: - *o++ = *s++; - } - } - - len = o - oo; - o = oo; - - if ( (oo = (Byte *)LDAP_REALLOC( o, len )) == NULL ) { - LDAP_FREE( o ); - return( 1 ); - } - - if ( free_input ) { - LDAP_FREE( *bufp ); - } - *bufp = (char *) oo; - *buflenp = len; - return( 0 ); -} - - -#ifdef NOT_NEEDED_IN_LIBLDAP /* mcs@umich.edu 12 Oct 1995 */ -/* --- routine to convert "escaped" (\hh) characters to 8bits --- */ - -void convert_escaped_to_8bit( s ) -char *s; -{ - char *o = s; - int c; - - while ( *s ) { - if ( *s == '\\' ) { - if ( (c = hh_to_c( (Byte *) ++s )) != -1 ) { - *o++ = c; - s += 2; - } else - *o++ = '\\'; - } else - *o++ = *s++; - } - *o = '\0'; -} - -/* --- routine to convert 8bits characters to the "escaped" (\hh) form --- */ - -char *convert_8bit_to_escaped( s ) -const Byte *s; -{ - Byte *o, *oo; - Byte n; - - if ( (o = oo = (Byte *)LDAP_MALLOC( 2 * strlen( s ) + 64 )) == NULL ) { - return( NULL ); - } - - while ( *s ) { - if ( *s < 0x80 ) - *o++ = *s++; - else { - *o++ = '\\'; - n = *s >> 4; - *o++ = ((n < 0xA) ? '0' : 'A' - 0xA) + n; - n = *s++ & 0x0F; - *o++ = ((n < 0xA) ? '0' : 'A' - 0xA) + n; - } - } - *o = '\0'; - - o = oo; - - if ( (oo = (Byte *)LDAP_REALLOC( o, strlen( o ) + 1 )) == NULL ) { - LDAP_FREE( o ); - return( NULL ); - } - - return( (char *)oo ); -} - -/* --- routine to convert from T.61 to printable characters --- */ - -/* - printable characters [RFC 1488]: 'A'..'Z', 'a'..'z', '0'..'9', - '\'', '(', ')', '+', ',', '-', '.', '/', ':', '?, ' '. - - that conversion is language dependent. -*/ - -static const Couple last_t61_printabled[32] = { - {0,0}, {'A','E'}, {'D',0}, {0,0}, - {'H',0}, {0,0}, {'I','J'}, {'L',0}, - {'L',0}, {'O',0}, {'O','E'}, {0,0}, - {'T','H'}, {'T',0}, {'N','G'}, {'n',0}, - {'k',0}, {'a','e'}, {'d',0}, {'d',0}, - {'h',0}, {'i',0}, {'i','j'}, {'l',0}, - {'l',0}, {'o',0}, {'o','e'}, {'s','s'}, - {'t','h'}, {'t',0}, {'n','g'}, {0,0} -}; - -char *t61_printable( s ) -Byte *s; -{ - Byte *o, *oo; - Byte n; - const Couple *cc; - - if ( (o = oo = (Byte *)LDAP_MALLOC( 2 * strlen( s ) + 64 )) == NULL ) { - return( NULL ); - } - - while ( *s ) { - if ( ( (*s >= 'A') && (*s <= 'Z') ) || - ( (*s >= 'a') && (*s <= 'z') ) || - ( (*s >= '0') && (*s <= '9') ) || - ( (*s >= '\'') && (*s <= ')') ) || - ( (*s >= '+') && (*s <= '/') ) || - ( *s == '?' ) || ( *s == ' ' ) ) - *o++ = *s++; - else { - if ( *s >= 0xE0 ) { - if ( (*(cc = &last_t61_printabled[ *s - 0xE0 ])).a ) { - *o++ = (*cc).a; - if ( (*cc).b ) *o++ = (*cc).b; - } - } - else if ( (*s >> 4) == 0xC ) { - switch ( *s ) { - case 0xCA: /* ring */ - switch ( *(s + 1) ) { - case 'A': *o++ = 'A'; *o++ = 'A'; s++; break; /* Swedish */ - case 'a': *o++ = 'a'; *o++ = 'a'; s++; break; /* Swedish */ - } - break; - - case 0xC8: /* diaeresis */ - switch ( *(s + 1) ) { - case 'Y': *o++ = 'I'; *o++ = 'J'; s++; break; /* Dutch */ - case 'y': *o++ = 'i'; *o++ = 'j'; s++; break; /* Dutch */ - } - break; - } - } - s++; - } - } - *o = '\0'; - - o = oo; - - if ( (oo = (Byte *)LDAP_REALLOC( o, strlen( o ) + 1 )) == NULL ) { - LDAP_FREE( o ); - return( NULL ); - } - - return( (char *)oo ); -} -#endif /* NOT_NEEDED_IN_LIBLDAP */ /* mcs@umich.edu 12 Oct 1995 */ - -#endif /* LDAP_CHARSET_8859 */ -#endif /* STR_TRANSLATION */ diff --git a/libraries/libldap/kbind.c b/libraries/libldap/kbind.c index 3f6f20cdd1..fd6d59ab7f 100644 --- a/libraries/libldap/kbind.c +++ b/libraries/libldap/kbind.c @@ -63,9 +63,6 @@ ldap_kerberos_bind1( LDAP *ld, LDAP_CONST char *dn ) char *cred; int rc; ber_len_t credlen; -#ifdef STR_TRANSLATION - int str_translation_on; -#endif /* STR_TRANSLATION */ Debug( LDAP_DEBUG_TRACE, "ldap_kerberos_bind1\n", 0, 0, 0 ); @@ -83,23 +80,10 @@ ldap_kerberos_bind1( LDAP *ld, LDAP_CONST char *dn ) return( -1 ); } -#ifdef STR_TRANSLATION - if (( str_translation_on = (( ber->ber_options & - LBER_TRANSLATE_STRINGS ) != 0 ))) { /* turn translation off */ - ber->ber_options &= ~LBER_TRANSLATE_STRINGS; - } -#endif /* STR_TRANSLATION */ - /* fill it in */ rc = ber_printf( ber, "{it{isto}}", ++ld->ld_msgid, LDAP_REQ_BIND, ld->ld_version, dn, LDAP_AUTH_KRBV41, cred, credlen ); -#ifdef STR_TRANSLATION - if ( str_translation_on ) { /* restore translation */ - ber->ber_options |= LBER_TRANSLATE_STRINGS; - } -#endif /* STR_TRANSLATION */ - if ( rc == -1 ) { LDAP_FREE( cred ); ber_free( ber, 1 ); @@ -157,9 +141,6 @@ ldap_kerberos_bind2( LDAP *ld, LDAP_CONST char *dn ) char *cred; int rc; ber_len_t credlen; -#ifdef STR_TRANSLATION - int str_translation_on; -#endif /* STR_TRANSLATION */ Debug( LDAP_DEBUG_TRACE, "ldap_kerberos_bind2\n", 0, 0, 0 ); @@ -177,24 +158,11 @@ ldap_kerberos_bind2( LDAP *ld, LDAP_CONST char *dn ) return( -1 ); } -#ifdef STR_TRANSLATION - if (( str_translation_on = (( ber->ber_options & - LBER_TRANSLATE_STRINGS ) != 0 ))) { /* turn translation off */ - ber->ber_options &= ~LBER_TRANSLATE_STRINGS; - } -#endif /* STR_TRANSLATION */ - /* fill it in */ rc = ber_printf( ber, "{it{isto}}", ++ld->ld_msgid, LDAP_REQ_BIND, ld->ld_version, dn, LDAP_AUTH_KRBV42, cred, credlen ); -#ifdef STR_TRANSLATION - if ( str_translation_on ) { /* restore translation */ - ber->ber_options |= LBER_TRANSLATE_STRINGS; - } -#endif /* STR_TRANSLATION */ - LDAP_FREE( cred ); if ( rc == -1 ) { diff --git a/libraries/libldap/ldap-int.h b/libraries/libldap/ldap-int.h index 4240ca5f17..acb912cf52 100644 --- a/libraries/libldap/ldap-int.h +++ b/libraries/libldap/ldap-int.h @@ -279,8 +279,6 @@ struct ldap { void **ld_cldapaddrs;/* addresses to send request to */ /* do not mess with the rest though */ - BERTranslateProc ld_lber_encode_translate_proc; - BERTranslateProc ld_lber_decode_translate_proc; LDAPConn *ld_defconn; /* default connection */ LDAPConn *ld_conns; /* list of server connections */ @@ -497,21 +495,6 @@ LIBLDAP_F (void) ldap_free_urllist LDAP_P(( LDAPURLDesc *ludlist )); - -#if defined( STR_TRANSLATION ) && defined( LDAP_DEFAULT_CHARSET ) -/* - * in charset.c - * - * added-in this stuff so that libldap.a would build, i.e. refs to - * these routines from open.c would resolve. - * hodges@stanford.edu 5-Feb-96 - */ -#if LDAP_CHARSET_8859 == LDAP_DEFAULT_CHARSET -LIBLDAP_F (int) ldap_t61_to_8859( char **bufp, ber_len_t *buflenp, int free_input ); -LIBLDAP_F (int) ldap_8859_to_t61( char **bufp, ber_len_t *buflenp, int free_input ); -#endif /* LDAP_CHARSET_8859 == LDAP_DEFAULT_CHARSET */ -#endif /* STR_TRANSLATION && LDAP_DEFAULT_CHARSET */ - LDAP_END_DECL #endif /* _LDAP_INT_H */ diff --git a/libraries/libldap/open.c b/libraries/libldap/open.c index 5ef67831e5..d8b1aaeb55 100644 --- a/libraries/libldap/open.c +++ b/libraries/libldap/open.c @@ -155,13 +155,6 @@ ldap_create( LDAP **ldp ) ld->ld_lberoptions = LBER_USE_DER; -#if defined( STR_TRANSLATION ) && defined( LDAP_DEFAULT_CHARSET ) - ld->ld_lberoptions |= LBER_TRANSLATE_STRINGS; -#if LDAP_CHARSET_8859 == LDAP_DEFAULT_CHARSET - ldap_set_string_translators( ld, ldap_8859_to_t61, ldap_t61_to_8859 ); -#endif /* LDAP_CHARSET_8859 == LDAP_DEFAULT_CHARSET */ -#endif /* STR_TRANSLATION && LDAP_DEFAULT_CHARSET */ - ld->ld_sb = ber_sockbuf_alloc( ); if ( ld->ld_sb == NULL ) { ldap_free_urllist( ld->ld_options.ldo_defludp ); diff --git a/libraries/libldap/request.c b/libraries/libldap/request.c index 110e8b7000..cabdaca6b3 100644 --- a/libraries/libldap/request.c +++ b/libraries/libldap/request.c @@ -61,10 +61,6 @@ ldap_alloc_ber_with_options( LDAP *ld ) if (( ber = ber_alloc_t( ld->ld_lberoptions )) == NULL ) { ld->ld_errno = LDAP_NO_MEMORY; -#ifdef STR_TRANSLATION - } else { - ldap_set_ber_options( ld, ber ); -#endif /* STR_TRANSLATION */ } return( ber ); @@ -75,13 +71,6 @@ void ldap_set_ber_options( LDAP *ld, BerElement *ber ) { ber->ber_options = ld->ld_lberoptions; -#ifdef STR_TRANSLATION - if (( ld->ld_lberoptions & LBER_TRANSLATE_STRINGS ) != 0 ) { - ber_set_string_translators( ber, - ld->ld_lber_encode_translate_proc, - ld->ld_lber_decode_translate_proc ); - } -#endif /* STR_TRANSLATION */ } diff --git a/libraries/libldap/test.c b/libraries/libldap/test.c index fc69532920..404ffbfe29 100644 --- a/libraries/libldap/test.c +++ b/libraries/libldap/test.c @@ -763,26 +763,6 @@ main( int argc, char **argv ) LDAP_BOOL_ZERO(&ld->ld_options); -#ifdef STR_TRANSLATION - getline( line, sizeof(line), stdin, - "Automatic translation of T.61 strings (0=no, 1=yes)?" ); - if ( atoi( line ) == 0 ) { - ld->ld_lberoptions &= ~LBER_TRANSLATE_STRINGS; - } else { - ld->ld_lberoptions |= LBER_TRANSLATE_STRINGS; -#ifdef LDAP_CHARSET_8859 - getline( line, sizeof(line), stdin, - "Translate to/from ISO-8859 (0=no, 1=yes?" ); - if ( atoi( line ) != 0 ) { - ldap_set_string_translators( ld, - ldap_8859_to_t61, - ldap_t61_to_8859 ); - } -#endif /* LDAP_CHARSET_8859 */ - } -#endif /* STR_TRANSLATION */ - - getline( line, sizeof(line), stdin, "Recognize and chase referrals (0=no, 1=yes)?" ); if ( atoi( line ) != 0 ) { diff --git a/libraries/libldap_r/Makefile.in b/libraries/libldap_r/Makefile.in index 1738eb230a..e7191f5687 100644 --- a/libraries/libldap_r/Makefile.in +++ b/libraries/libldap_r/Makefile.in @@ -16,7 +16,7 @@ XXSRCS = apitest.c test.c tmpltest.c extended.c \ getfilter.c sasl.c sbind.c kbind.c unbind.c friendly.c cldap.c \ free.c disptmpl.c srchpref.c dsparse.c tmplout.c sort.c \ getdn.c getentry.c getattr.c getvalues.c addentry.c \ - request.c os-ip.c url.c charset.c \ + request.c os-ip.c url.c \ init.c options.c print.c string.c util-int.c schema.c \ charray.c digest.c tls.c dn.c os-local.c dnssrv.c \ utf-8.c @@ -28,7 +28,7 @@ OBJS = extended.lo \ getfilter.lo sasl.lo sbind.lo kbind.lo unbind.lo friendly.lo cldap.lo \ free.lo disptmpl.lo srchpref.lo dsparse.lo tmplout.lo sort.lo \ getdn.lo getentry.lo getattr.lo getvalues.lo addentry.lo \ - request.lo os-ip.lo url.lo charset.lo \ + request.lo os-ip.lo url.lo \ init.lo options.lo print.lo string.lo util-int.lo schema.lo \ thr_posix.lo thr_cthreads.lo thr_thr.lo thr_lwp.lo thr_nt.lo \ thr_pth.lo thr_sleep.lo thr_stub.lo rdwr.lo \