1N/A/*
1N/A * Portions Copyright 1998 Sun Microsystems, Inc. All rights reserved.
1N/A * Use is subject to license terms.
1N/A */
1N/A
1N/A#pragma ident "%Z%%M% %I% %E% SMI"
1N/A
1N/A/*
1N/A * Copyright (c) 1995 Regents of the University of Michigan.
1N/A * All rights reserved.
1N/A *
1N/A * charset.c
1N/A */
1N/A
1N/A#if defined( DOS ) || defined( _WIN32 )
1N/A/*
1N/A * This MUST precede "#ifdef STR_TRANSLATION"
1N/A * because STR_TRANSLATION and friends are defined in msdos.h.
1N/A */
1N/A#include "msdos.h"
1N/A#endif /* DOS */
1N/A
1N/A#ifdef STR_TRANSLATION
1N/A
1N/A#ifndef lint
1N/Astatic char copyright[] = "@(#) Copyright (c) 1995 Regents of the University of Michigan.\nAll rights reserved.\n";
1N/A#endif
1N/A
1N/A#include <stdio.h>
1N/A#include <string.h>
1N/A
1N/A#ifdef MACOS
1N/A#include <stdlib.h>
1N/A#include "macos.h"
1N/A#endif /* MACOS */
1N/A
1N/A#if !defined(MACOS) && !defined(DOS) && !defined( _WIN32 ) && !defined(VMS)
1N/A#include <sys/time.h>
1N/A#include <sys/types.h>
1N/A#include <sys/socket.h>
1N/A#include <sys/param.h>
1N/A#endif
1N/A#include "lber.h"
1N/A#include "ldap.h"
1N/A#include "ldap-private.h"
1N/A#include "ldap-int.h"
1N/A
1N/A
1N/Avoid
1N/Aldap_set_string_translators( LDAP *ld, BERTranslateProc encode_proc,
1N/A BERTranslateProc decode_proc )
1N/A{
1N/A#if defined( SUN ) && defined( _REENTRANT )
1N/A LOCK_LDAP(ld);
1N/A#endif
1N/A ld->ld_lber_encode_translate_proc = encode_proc;
1N/A ld->ld_lber_decode_translate_proc = decode_proc;
1N/A#if defined( SUN ) && defined( _REENTRANT )
1N/A UNLOCK_LDAP(ld);
1N/A#endif
1N/A}
1N/A
1N/A
1N/Avoid
1N/Aldap_enable_translation( LDAP *ld, LDAPMessage *entry, int enable )
1N/A{
1N/A char *optionsp;
1N/A
1N/A#if defined( SUN ) && defined( _REENTRANT )
1N/A LOCK_LDAP(ld);
1N/A#endif
1N/A optionsp = ( entry == NULLMSG ) ? &ld->ld_lberoptions :
1N/A &entry->lm_ber->ber_options;
1N/A
1N/A if ( enable ) {
1N/A *optionsp |= LBER_TRANSLATE_STRINGS;
1N/A } else {
1N/A *optionsp &= ~LBER_TRANSLATE_STRINGS;
1N/A }
1N/A#if defined( SUN ) && defined( _REENTRANT )
1N/A UNLOCK_LDAP(ld);
1N/A#endif
1N/A}
1N/A
1N/A
1N/Aint
1N/Aldap_translate_from_t61( LDAP *ld, char **bufp, unsigned int *lenp,
1N/A int free_input )
1N/A{
1N/A#if defined( SUN ) && defined( _REENTRANT )
1N/A BERTranslateProc decode_proc;
1N/A
1N/A LOCK_LDAP(ld);
1N/A#endif
1N/A if ( ld->ld_lber_decode_translate_proc == NULL ) {
1N/A#if defined( SUN ) && defined( _REENTRANT )
1N/A UNLOCK_LDAP(ld);
1N/A#endif
1N/A return( LDAP_SUCCESS );
1N/A }
1N/A#if defined( SUN ) && defined( _REENTRANT )
1N/A decode_proc = ld->ld_lber_decode_translate_proc;
1N/A UNLOCK_LDAP(ld);
1N/A
1N/A return( (*decode_proc)( bufp, lenp, free_input ));
1N/A#else
1N/A return( (*ld->ld_lber_decode_translate_proc)( bufp, lenp, free_input ));
1N/A#endif
1N/A}
1N/A
1N/A
1N/Aint
1N/Aldap_translate_to_t61( LDAP *ld, char **bufp, unsigned int *lenp,
1N/A int free_input )
1N/A{
1N/A#if defined( SUN ) && defined( _REENTRANT )
1N/A BERTranslateProc encode_proc;
1N/A
1N/A LOCK_LDAP(ld);
1N/A#endif
1N/A if ( ld->ld_lber_encode_translate_proc == NULL ) {
1N/A#if defined( SUN ) && defined( _REENTRANT )
1N/A UNLOCK_LDAP(ld);
1N/A#endif
1N/A return( LDAP_SUCCESS );
1N/A }
1N/A
1N/A#if defined( SUN ) && defined( _REENTRANT )
1N/A encode_proc = ld->ld_lber_encode_translate_proc;
1N/A UNLOCK_LDAP(ld);
1N/A return( (*encode_proc)( bufp, lenp, free_input ));
1N/A#else
1N/A return( (*ld->ld_lber_encode_translate_proc)( bufp, lenp, free_input ));
1N/A#endif
1N/A}
1N/A
1N/A
1N/A/*
1N/A ** Character translation routine notes:
1N/A *
1N/A * On entry: bufp points to a "string" to be converted (not necessarily
1N/A * zero-terminated) and buflenp points to the length of the buffer.
1N/A *
1N/A * On exit: bufp should point to a malloc'd result. If free_input is
1N/A * non-zero then the original bufp will be freed. *buflenp should be
1N/A * set to the new length. Zero bytes in the input buffer must be left
1N/A * as zero bytes.
1N/A *
1N/A * Return values: any ldap error code (LDAP_SUCCESS if all goes well).
1N/A */
1N/A
1N/A
1N/A#ifdef LDAP_CHARSET_8859
1N/A
1N/A#if LDAP_CHARSET_8859 == 88591
1N/A#define ISO_8859 1
1N/A#elif LDAP_CHARSET_8859 == 88592
1N/A#define ISO_8859 2
1N/A#elif LDAP_CHARSET_8859 == 88593
1N/A#define ISO_8859 3
1N/A#elif LDAP_CHARSET_8859 == 88594
1N/A#define ISO_8859 4
1N/A#elif LDAP_CHARSET_8859 == 88595
1N/A#define ISO_8859 5
1N/A#elif LDAP_CHARSET_8859 == 88596
1N/A#define ISO_8859 6
1N/A#elif LDAP_CHARSET_8859 == 88597
1N/A#define ISO_8859 7
1N/A#elif LDAP_CHARSET_8859 == 88598
1N/A#define ISO_8859 8
1N/A#elif LDAP_CHARSET_8859 == 88599
1N/A#define ISO_8859 9
1N/A#elif LDAP_CHARSET_8859 == 885910
1N/A#define ISO_8859 10
1N/A#else
1N/A#define ISO_8859 0
1N/A#endif
1N/A
1N/A/*
1N/A * the following ISO_8859 to/afrom T.61 character set translation code is
1N/A * based on the code found in Enrique Silvestre Mora's iso-t61.c, found
1N/A * as part of this package:
1N/A * ftp://pereiii.uji.es/pub/uji-ftp/unix/ldap/iso-t61.translation.tar.Z
1N/A * Enrique is now (10/95) at this address: enrique.silvestre@uv.es
1N/A *
1N/A * changes made by mcs@umich.edu 12 October 1995:
1N/A * Change calling conventions of iso8859_t61() and t61_iso8859() to
1N/A * match libldap conventions; rename to ldap_8859_to_t61() and
1N/A * ldap_t61_to_8859().
1N/A * Change conversion routines to deal with non-zero terminated strings.
1N/A * ANSI-ize functions and include prototypes.
1N/A */
1N/A
1N/A/* iso-t61.c - ISO-T61 translation routines (version: 0.2.1, July-1994) */
1N/A/*
1N/A * Copyright (c) 1994 Enrique Silvestre Mora, Universitat Jaume I, Spain.
1N/A * All rights reserved.
1N/A *
1N/A * Redistribution and use in source and binary forms are permitted
1N/A * provided that this notice is preserved and that due credit is given
1N/A * to the Universitat Jaume I. The name of the University
1N/A * may not be used to endorse or promote products derived from this
1N/A * software without specific prior written permission. This software
1N/A * is provided ``as is'' without express or implied warranty.
1N/A*/
1N/A
1N/A
1N/A#include <stdio.h>
1N/A#include <stdlib.h>
1N/A#include <string.h>
1N/A
1N/A/* Character set used: ISO 8859-1, ISO 8859-2, ISO 8859-3, ... */
1N/A/* #define ISO_8859 1 */
1N/A
1N/A#ifndef ISO_8859
1N/A# define ISO_8859 0
1N/A#endif
1N/A
1N/Atypedef unsigned char Byte;
1N/Atypedef struct { Byte a, b; } Couple;
1N/A
1N/A#ifdef NEEDPROTOS
1N/Astatic Byte *c_to_hh( Byte *o, Byte c );
1N/Astatic Byte *c_to_cc( Byte *o, Couple *cc, Byte c );
1N/Astatic int hh_to_c( Byte *h );
1N/Astatic Byte *cc_to_t61( Byte *o, Byte *s );
1N/A#else /* NEEDPROTOS */
1N/Astatic Byte *c_to_hh();
1N/Astatic Byte *c_to_cc();
1N/Astatic int hh_to_c();
1N/Astatic Byte *cc_to_t61();
1N/A#endif /* NEEDPROTOS */
1N/A
1N/A/*
1N/A Character choosed as base in diacritics alone: NO-BREAK SPACE.
1N/A (The standard say it must be a blank space, 0x20.)
1N/A*/
1N/A#define ALONE 0xA0
1N/A
1N/Astatic Couple diacritic[16] = {
1N/A#if (ISO_8859 == 1) || (ISO_8859 == 9)
1N/A {0,0}, {'`',0}, {0xb4,0}, {'^',0},
1N/A {'~',0}, {0xaf,0}, {'(',ALONE}, {'.',ALONE},
1N/A {0xa8,0}, {0,0}, {'0',ALONE}, {0xb8,0},
1N/A {0,0}, {'"',ALONE}, {';',ALONE}, {'<',ALONE},
1N/A#elif (ISO_8859 == 2)
1N/A {0,0}, {'`',0}, {0xb4,0}, {'^',0},
1N/A {'~',0}, {'-',ALONE}, {0xa2,0}, {0xff,0},
1N/A {0xa8,0}, {0,0}, {'0',ALONE}, {0xb8,0},
1N/A {0,0}, {0xbd,0}, {0xb2,0}, {0xb7,0}
1N/A#elif (ISO_8859 == 3)
1N/A {0,0}, {'`',0}, {0xb4,0}, {'^',0},
1N/A {'~',0}, {'-',ALONE}, {0xa2,0}, {0xff,0},
1N/A {0xa8,0}, {0,0}, {'0',ALONE}, {0xb8,0},
1N/A {0,0}, {'"',ALONE}, {';',ALONE}, {'<',ALONE}
1N/A#elif (ISO_8859 == 4)
1N/A {0,0}, {'`',0}, {0xb4,0}, {'^',0},
1N/A {'~',0}, {0xaf,0}, {'(',ALONE}, {0xff,0},
1N/A {0xa8,0}, {0,0}, {'0',ALONE}, {0xb8,0},
1N/A {0,0}, {'"',ALONE}, {0xb2,0}, {0xb7,0}
1N/A#else
1N/A {0,0}, {'`',0}, {'\'',ALONE}, {'^',0},
1N/A {'~',0}, {'-',ALONE}, {'(',ALONE}, {'.',ALONE},
1N/A {':',ALONE}, {0,0}, {'0',ALONE}, {',',ALONE},
1N/A {0,0}, {'"',ALONE}, {';',ALONE}, {'<',ALONE}
1N/A#endif
1N/A};
1N/A
1N/A/*
1N/A --- T.61 (T.51) letters with diacritics: conversion to ISO 8859-n -----
1N/A A, C, D, E, G, H, I, J, K,
1N/A L, N, O, R, S, T, U, W, Y, Z.
1N/A -----------------------------------------------------------------------
1N/A*/
1N/Astatic int letter_w_diacritic[16][38] = {
1N/A#if (ISO_8859 == 1)
1N/A 0, 0, 0, 0, 0, 0, 0, 0, 0,
1N/A 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 0, 0, 0, 0, 0, 0, 0, 0,
1N/A 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1N/A 0, 0, 0, 0, 0, 0, 0, 0, 0,
1N/A 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1N/A 0, 0, 0, 0, 0, 0, 0, 0, 0,
1N/A 0, 0, -1, 0, 0, 0, -1, 0, 0, 0,
1N/A 0, 0, 0, 0, 0, 0, 0, 0, 0,
1N/A 0, 0, -1, 0, 0, 0, -1, 0, 0, 0,
1N/A -1, 0, 0, -1, 0, 0, -1, 0, 0,
1N/A 0, 0, 0, 0, 0, 0, -1, 0, 0, 0,
1N/A -1, 0, 0, -1, 0, 0, -1, 0, 0,
1N/A 0, 0, 0, 0, 0, 0, -1, 0, 0, 0,
1N/A 0, -1, -1, -1, 0, 0, 0, 0, 0,
1N/A -1, -1, 0, -1, -1, -1, 0, 0, 0, -1,
1N/A 0, -1, -1, -1, 0, 0, 0, 0, 0,
1N/A -1, -1, 0, -1, -1, -1, 0, 0, 0, -1
1N/A#endif
1N/A};
1N/A
1N/A/*
1N/A--- T.61 characters [0xA0 .. 0xBF] -----------------
1N/A*/
1N/Astatic Couple trans_t61a_iso8859[32] = {
1N/A#if (ISO_8859 == 1) || (ISO_8859 == 9)
1N/A {'N','S'}, {0xa1,0}, {0xa2,0}, {0xa3,0},
1N/A {'D','O'}, {0xa5,0}, {'C','u'}, {0xa7,0},
1N/A {0xa4,0}, {'\'','6'},{'"','6'}, {0xab,0},
1N/A {'<','-'}, {'-','!'}, {'-','>'}, {'-','v'},
1N/A {0xb0,0}, {0xb1,0}, {0xb2,0}, {0xb3,0},
1N/A {0xd7,0}, {0xb5,0}, {0xb6,0}, {0xb7,0},
1N/A {0xf7,0}, {'\'','9'},{'"','9'}, {0xbb,0},
1N/A {0xbc,0}, {0xbd,0}, {0xbe,0}, {0xbf,0}
1N/A#elif (ISO_8859 == 2) || (ISO_8859 == 4)
1N/A {'N','S'}, {'!','I'}, {'C','t'}, {'P','d'},
1N/A {'D','O'}, {'Y','e'}, {'C','u'}, {0xa7,0},
1N/A {0xa4,0}, {'\'','6'},{'"','6'}, {'<','<'},
1N/A {'<','-'}, {'-','!'}, {'-','>'}, {'-','v'},
1N/A {0xb0,0}, {'+','-'}, {'2','S'}, {'3','S'},
1N/A {0xd7,0}, {'M','y'}, {'P','I'}, {'.','M'},
1N/A {0xf7,0}, {'\'','9'},{'"','9'}, {'>','>'},
1N/A {'1','4'}, {'1','2'}, {'3','4'}, {'?','I'},
1N/A#elif (ISO_8859 == 3)
1N/A {'N','S'}, {'!','I'}, {'C','t'}, {0xa3,0},
1N/A {'D','O'}, {'Y','e'}, {'C','u'}, {0xa7,0},
1N/A {0xa4,0}, {'\'','6'},{'"','6'}, {'<','<'},
1N/A {'<','-'}, {'-','!'}, {'-','>'}, {'-','v'},
1N/A {0xb0,0}, {'+','-'}, {0xb2,0}, {0xb3,0},
1N/A {0xd7,0}, {0xb5,0}, {'P','I'}, {0xb7,0},
1N/A {0xf7,0}, {'\'','9'},{'"','9'}, {'>','>'},
1N/A {'1','4'}, {0xbd,0}, {'3','4'}, {'?','I'}
1N/A#elif (ISO_8859 == 10)
1N/A {'N','S'}, {'!','I'}, {'C','t'}, {'P','d'},
1N/A {'D','O'}, {'Y','e'}, {'C','u'}, {0xa7,0},
1N/A {'C','u'}, {'\'','6'},{'"','6'}, {'<','<'},
1N/A {'<','-'}, {'-','!'}, {'-','>'}, {'-','v'},
1N/A {0xb0,0}, {'+','-'}, {'2','S'}, {'3','S'},
1N/A {'*','X'}, {'M','y'}, {'P','I'}, {0xb7,0},
1N/A {'-',':'}, {'\'','9'},{'"','9'}, {'>','>'},
1N/A {'1','4'}, {'1','2'}, {'3','4'}, {'?','I'}
1N/A#else
1N/A {'N','S'}, {'!','I'}, {'C','t'}, {'P','d'},
1N/A {'D','O'}, {'Y','e'}, {'C','u'}, {'S','E'},
1N/A {'X','O'}, {'\'','6'},{'"','6'}, {'<','<'},
1N/A {'<','-'}, {'-','!'}, {'-','>'}, {'-','v'},
1N/A {'D','G'}, {'+','-'}, {'2','S'}, {'3','S'},
1N/A {'*','X'}, {'M','y'}, {'P','I'}, {'.','M'},
1N/A {'-',':'}, {'\'','9'},{'"','9'}, {'>','>'},
1N/A {'1','4'}, {'1','2'}, {'3','4'}, {'?','I'}
1N/A#endif
1N/A};
1N/A
1N/A/*
1N/A--- T.61 characters [0xE0 .. 0xFF] -----------------
1N/A*/
1N/Astatic Couple trans_t61b_iso8859[48] = {
1N/A#if (ISO_8859 == 1)
1N/A {'-','M'}, {0xb9,0}, {0xae,0}, {0xa9,0},
1N/A {'T','M'}, {'M','8'}, {0xac,0}, {0xa6,0},
1N/A {0,0}, {0,0}, {0,0}, {0,0},
1N/A {'1','8'}, {'3','8'}, {'5','8'}, {'7','8'},
1N/A {'O','m'}, {0xc6,0}, {0xd0,0}, {0xaa,0},
1N/A {'H','/'}, {0,0}, {'I','J'}, {'L','.'},
1N/A {'L','/'}, {0xd8,0}, {'O','E'}, {0xba,0},
1N/A {0xde,0}, {'T','/'}, {'N','G'}, {'\'','n'},
1N/A {'k','k'}, {0xe6,0}, {'d','/'}, {0xf0,0},
1N/A {'h','/'}, {'i','.'}, {'i','j'}, {'l','.'},
1N/A {'l','/'}, {0xf8,0}, {'o','e'}, {0xdf,0},
1N/A {0xfe,0}, {'t','/'}, {'n','g'}, {'-','-'}
1N/A#elif (ISO_8859 == 2)
1N/A {'-','M'}, {'1','S'}, {'R','g'}, {'C','o'},
1N/A {'T','M'}, {'M','8'}, {'N','O'}, {'B','B'},
1N/A {0,0}, {0,0}, {0,0}, {0,0},
1N/A {'1','8'}, {'3','8'}, {'5','8'}, {'7','8'},
1N/A {'O','m'}, {'A','E'}, {0xd0,0}, {'-','a'},
1N/A {'H','/'}, {0,0}, {'I','J'}, {'L','.'},
1N/A {0xa3,0}, {'O','/'}, {'O','E'}, {'-','o'},
1N/A {'T','H'}, {'T','/'}, {'N','G'}, {'\'','n'},
1N/A {'k','k'}, {'a','e'}, {0xf0,0}, {'d','-'},
1N/A {'h','/'}, {'i','.'}, {'i','j'}, {'l','.'},
1N/A {0xb3,0}, {'o','/'}, {'o','e'}, {0xdf,0},
1N/A {'t','h'}, {'t','/'}, {'n','g'}, {'-','-'}
1N/A#elif (ISO_8859 == 3)
1N/A {'-','M'}, {'1','S'}, {'R','g'}, {'C','o'},
1N/A {'T','M'}, {'M','8'}, {'N','O'}, {'B','B'},
1N/A {0,0}, {0,0}, {0,0}, {0,0},
1N/A {'1','8'}, {'3','8'}, {'5','8'}, {'7','8'},
1N/A {'O','m'}, {'A','E'}, {'D','/'}, {'-','a'},
1N/A {0xa1,0}, {0,0}, {'I','J'}, {'L','.'},
1N/A {'L','/'}, {'O','/'}, {'O','E'}, {'-','o'},
1N/A {'T','H'}, {'T','/'}, {'N','G'}, {'\'','n'},
1N/A {'k','k'}, {'a','e'}, {'d','/'}, {'d','-'},
1N/A {0xb1,0}, {0xb9,0}, {'i','j'}, {'l','.'},
1N/A {'l','/'}, {'o','/'}, {'o','e'}, {0xdf,0},
1N/A {'t','h'}, {'t','/'}, {'n','g'}, {'-','-'}
1N/A#elif (ISO_8859 == 4)
1N/A {'-','M'}, {'1','S'}, {'R','g'}, {'C','o'},
1N/A {'T','M'}, {'M','8'}, {'N','O'}, {'B','B'},
1N/A {0,0}, {0,0}, {0,0}, {0,0},
1N/A {'1','8'}, {'3','8'}, {'5','8'}, {'7','8'},
1N/A {'O','m'}, {0xc6,0}, {0xd0,0}, {'-','a'},
1N/A {'H','/'}, {0,0}, {'I','J'}, {'L','.'},
1N/A {'L','/'}, {0xd8,0}, {'O','E'}, {'-','o'},
1N/A {'T','H'}, {0xac,0}, {0xbd,0}, {'\'','n'},
1N/A {0xa2,0}, {0xe6,0}, {0xf0,0}, {'d','-'},
1N/A {'h','/'}, {'i','.'}, {'i','j'}, {'l','.'},
1N/A {'l','/'}, {0xf8,0}, {'o','e'}, {0xdf,0},
1N/A {'t','h'}, {0xbc,0}, {0xbf,0}, {'-','-'}
1N/A#elif (ISO_8859 == 9)
1N/A {'-','M'}, {0xb9,0}, {0xae,0}, {0xa9,0},
1N/A {'T','M'}, {'M','8'}, {0xac,0}, {0xa6,0},
1N/A {0,0}, {0,0}, {0,0}, {0,0},
1N/A {'1','8'}, {'3','8'}, {'5','8'}, {'7','8'},
1N/A {'O','m'}, {0xc6,0}, {'D','/'}, {0xaa,0},
1N/A {'H','/'}, {0,0}, {'I','J'}, {'L','.'},
1N/A {'L','/'}, {0xd8,0}, {'O','E'}, {0xba,0},
1N/A {'T','H'}, {'T','/'}, {'N','G'}, {'\'','n'},
1N/A {'k','k'}, {0xe6,0}, {'d','/'}, {'d','-'},
1N/A {'h','/'}, {0xfd,0}, {'i','j'}, {'l','.'},
1N/A {'l','/'}, {0xf8,0}, {'o','e'}, {0xdf,0},
1N/A {'t','h'}, {'t','/'}, {'n','g'}, {'-','-'}
1N/A#elif (ISO_8859 == 10)
1N/A {0xbd,0}, {'1','S'}, {'R','g'}, {'C','o'},
1N/A {'T','M'}, {'M','8'}, {'N','O'}, {'B','B'},
1N/A {0,0}, {0,0}, {0,0}, {0,0},
1N/A {'1','8'}, {'3','8'}, {'5','8'}, {'7','8'},
1N/A {'O','m'}, {0xc6,0}, {0xa9,0}, {'-','a'},
1N/A {'H','/'}, {0,0}, {'I','J'}, {'L','.'},
1N/A {'L','/'}, {0xd8,0}, {'O','E'}, {'-','o'},
1N/A {0xde,0}, {0xab,0}, {0xaf,0}, {'\'','n'},
1N/A {0xff,0}, {0xe6,0}, {0xb9,0}, {0xf0,0},
1N/A {'h','/'}, {'i','.'}, {'i','j'}, {'l','.'},
1N/A {'l','/'}, {0xf8,0}, {'o','e'}, {0xdf,0},
1N/A {0xfe,0}, {0xbb,0}, {0xbf,0}, {'-','-'}
1N/A#else
1N/A {'-','M'}, {'1','S'}, {'R','g'}, {'C','o'},
1N/A {'T','M'}, {'M','8'}, {'N','O'}, {'B','B'},
1N/A {0,0}, {0,0}, {0,0}, {0,0},
1N/A {'1','8'}, {'3','8'}, {'5','8'}, {'7','8'},
1N/A {'O','m'}, {'A','E'}, {'D','/'}, {'-','a'},
1N/A {'H','/'}, {0,0}, {'I','J'}, {'L','.'},
1N/A {'L','/'}, {'O','/'}, {'O','E'}, {'-','o'},
1N/A {'T','H'}, {'T','/'}, {'N','G'}, {'\'','n'},
1N/A {'k','k'}, {'a','e'}, {'d','/'}, {'d','-'},
1N/A {'h','/'}, {'i','.'}, {'i','j'}, {'l','.'},
1N/A {'l','/'}, {'o','/'}, {'o','e'}, {'s','s'},
1N/A {'t','h'}, {'t','-'}, {'n','g'}, {'-','-'}
1N/A#endif
1N/A};
1N/A
1N/A/*
1N/A--- ISO 8859-n characters <0xA0 .. 0xFF> -------------------
1N/A*/
1N/A#if (ISO_8859 == 1)
1N/Astatic Couple trans_iso8859_t61[96] = {
1N/A {0xa0,0}, {0xa1,0}, {0xa2,0}, {0xa3,0},
1N/A {0xa8,0}, {0xa5,0}, {0xd7,0}, {0xa7,0},
1N/A {0xc8,ALONE}, {0xd3,0}, {0xe3,0}, {0xab,0},
1N/A {0xd6,0}, {0xff,0}, {0xd2,0}, {0xc5,ALONE},
1N/A {0xb0,0}, {0xb1,0}, {0xb2,0}, {0xb3,0},
1N/A {0xc2,ALONE}, {0xb5,0}, {0xb6,0}, {0xb7,0},
1N/A {0xcb,ALONE}, {0xd1,0}, {0xeb,0}, {0xbb,0},
1N/A {0xbc,0}, {0xbd,0}, {0xbe,0}, {0xbf,0},
1N/A {0xc1,'A'}, {0xc2,'A'}, {0xc3,'A'}, {0xc4,'A'},
1N/A {0xc8,'A'}, {0xca,'A'}, {0xe1,0}, {0xcb,'C'},
1N/A {0xc1,'E'}, {0xc2,'E'}, {0xc3,'E'}, {0xc8,'E'},
1N/A {0xc1,'I'}, {0xc2,'I'}, {0xc3,'I'}, {0xc8,'I'},
1N/A {0xe2,0}, {0xc4,'N'}, {0xc1,'O'}, {0xc2,'O'},
1N/A {0xc3,'O'}, {0xc4,'O'}, {0xc8,'O'}, {0xb4,0},
1N/A {0xe9,0}, {0xc1,'U'}, {0xc2,'U'}, {0xc3,'U'},
1N/A {0xc8,'U'}, {0xc2,'Y'}, {0xec,0}, {0xfb,0},
1N/A {0xc1,'a'}, {0xc2,'a'}, {0xc3,'a'}, {0xc4,'a'},
1N/A {0xc8,'a'}, {0xca,'a'}, {0xf1,0}, {0xcb,'c'},
1N/A {0xc1,'e'}, {0xc2,'e'}, {0xc3,'e'}, {0xc8,'e'},
1N/A {0xc1,'i'}, {0xc2,'i'}, {0xc3,'i'}, {0xc8,'i'},
1N/A {0xf3,0}, {0xc4,'n'}, {0xc1,'o'}, {0xc2,'o'},
1N/A {0xc3,'o'}, {0xc4,'o'}, {0xc8,'o'}, {0xb8,0},
1N/A {0xf9,0}, {0xc1,'u'}, {0xc2,'u'}, {0xc3,'u'},
1N/A {0xc8,'u'}, {0xc2,'y'}, {0xfc,0}, {0xc8,'y'}
1N/A};
1N/A#elif (ISO_8859 == 2)
1N/Astatic Couple trans_iso8859_t61[96] = {
1N/A {0xa0,0}, {0xce,'A'}, {0xc6,ALONE}, {0xe8,0},
1N/A {0xa8,0}, {0xcf,'L'}, {0xc2,'S'}, {0xa7,0},
1N/A {0xc8,ALONE}, {0xcf,'S'}, {0xcb,'S'}, {0xcf,'T'},
1N/A {0xc2,'Z'}, {0xff,0}, {0xcf,'Z'}, {0xc7,'Z'},
1N/A {0xb0,0}, {0xce,'a'}, {0xce,ALONE}, {0xf8,0},
1N/A {0xc2,ALONE}, {0xcf,'l'}, {0xc2,'s'}, {0xcf,ALONE},
1N/A {0xcb,ALONE}, {0xcf,'s'}, {0xcb,'s'}, {0xcf,'t'},
1N/A {0xc2,'z'}, {0xcd,ALONE}, {0xcf,'z'}, {0xc7,'z'},
1N/A {0xc2,'R'}, {0xc2,'A'}, {0xc3,'A'}, {0xc6,'A'},
1N/A {0xc8,'A'}, {0xc2,'L'}, {0xc2,'C'}, {0xcb,'C'},
1N/A {0xcf,'C'}, {0xc2,'E'}, {0xce,'E'}, {0xc8,'E'},
1N/A {0xcf,'E'}, {0xc2,'I'}, {0xc3,'I'}, {0xcf,'D'},
1N/A {0xe2,0}, {0xc2,'N'}, {0xcf,'N'}, {0xc2,'O'},
1N/A {0xc3,'O'}, {0xcd,'O'}, {0xc8,'O'}, {0xb4,0},
1N/A {0xcf,'R'}, {0xca,'U'}, {0xc2,'U'}, {0xcd,'U'},
1N/A {0xc8,'U'}, {0xc2,'Y'}, {0xcb,'T'}, {0xfb,0},
1N/A {0xc2,'r'}, {0xc2,'a'}, {0xc3,'a'}, {0xc6,'a'},
1N/A {0xc8,'a'}, {0xc2,'l'}, {0xc2,'c'}, {0xcb,'c'},
1N/A {0xcf,'c'}, {0xc2,'e'}, {0xce,'e'}, {0xc8,'e'},
1N/A {0xcf,'e'}, {0xc2,'i'}, {0xc3,'i'}, {0xcf,'d'},
1N/A {0xf2,0}, {0xc2,'n'}, {0xcf,'n'}, {0xc2,'o'},
1N/A {0xc3,'o'}, {0xcd,'o'}, {0xc8,'o'}, {0xb8,0},
1N/A {0xcf,'r'}, {0xca,'u'}, {0xc2,'u'}, {0xcd,'u'},
1N/A {0xc8,'u'}, {0xc2,'y'}, {0xcb,'t'}, {0xc7,ALONE}
1N/A};
1N/A#elif (ISO_8859 == 3)
1N/Astatic Couple trans_iso8859_t61[96] = {
1N/A {0xa0,0}, {0xe4,0}, {0xc6,ALONE}, {0xa3,0},
1N/A {0xa8,0}, {0,0}, {0xc3,'H'}, {0xa7,0},
1N/A {0xc8,ALONE}, {0xc7,'I'}, {0xcb,'S'}, {0xc6,'G'},
1N/A {0xc3,'J'}, {0xff,0}, {0,0}, {0xc7,'Z'},
1N/A {0xb0,0}, {0xf4,0}, {0xb2,0}, {0xb3,0},
1N/A {0xc2,ALONE}, {0xb5,0}, {0xc3,'h'}, {0xb7,0},
1N/A {0xcb,ALONE}, {0xf5,0}, {0xcb,'s'}, {0xc6,'g'},
1N/A {0xc3,'j'}, {0xbd,0}, {0,0}, {0xc7,'z'},
1N/A {0xc1,'A'}, {0xc2,'A'}, {0xc3,'A'}, {0,0},
1N/A {0xc8,'A'}, {0xc7,'C'}, {0xc3,'C'}, {0xcb,'C'},
1N/A {0xc1,'E'}, {0xc2,'E'}, {0xc3,'E'}, {0xc8,'E'},
1N/A {0xc1,'I'}, {0xc2,'I'}, {0xc3,'I'}, {0xc8,'I'},
1N/A {0,0}, {0xc4,'N'}, {0xc1,'O'}, {0xc2,'O'},
1N/A {0xc3,'O'}, {0xc7,'G'}, {0xc8,'O'}, {0xb4,0},
1N/A {0xc3,'G'}, {0xc1,'U'}, {0xc2,'U'}, {0xc3,'U'},
1N/A {0xc8,'U'}, {0xc6,'U'}, {0xc3,'S'}, {0xfb,0},
1N/A {0xc1,'a'}, {0xc2,'a'}, {0xc3,'a'}, {0,0},
1N/A {0xc8,'a'}, {0xc7,'c'}, {0xc3,'c'}, {0xcb,'c'},
1N/A {0xc1,'e'}, {0xc2,'e'}, {0xc3,'e'}, {0xc8,'e'},
1N/A {0xc1,'i'}, {0xc2,'i'}, {0xc3,'i'}, {0xc8,'i'},
1N/A {0,0}, {0xc4,'n'}, {0xc1,'o'}, {0xc2,'o'},
1N/A {0xc3,'o'}, {0xc7,'g'}, {0xc8,'o'}, {0xb8,0},
1N/A {0xc3,'g'}, {0xc1,'u'}, {0xc2,'u'}, {0xc3,'u'},
1N/A {0xc8,'u'}, {0xc6,'u'}, {0xc3,'s'}, {0xc7,ALONE}
1N/A};
1N/A#elif (ISO_8859 == 4)
1N/Astatic Couple trans_iso8859_t61[96] = {
1N/A {0xa0,0}, {0xce,'A'}, {0xf0,0}, {0xcb,'R'},
1N/A {0xa8,0}, {0xc4,'I'}, {0xcb,'L'}, {0xa7,0},
1N/A {0xc8,ALONE}, {0xcf,'S'}, {0xc5,'E'}, {0xcb,'G'},
1N/A {0xed,0}, {0xff,0}, {0xcf,'Z'}, {0xc5,ALONE},
1N/A {0xb0,0}, {0xce,'a'}, {0xce,ALONE}, {0xcb,'r'},
1N/A {0xc2,ALONE}, {0xc4,'i'}, {0xcb,'l'}, {0xcf,ALONE},
1N/A {0xcb,ALONE}, {0xcf,'s'}, {0xc5,'e'}, {0xcb,'g'},
1N/A {0xfd,0}, {0xee,0}, {0xcf,'z'}, {0xfe,0},
1N/A {0xc5,'A'}, {0xc2,'A'}, {0xc3,'A'}, {0xc4,'A'},
1N/A {0xc8,'A'}, {0xca,'A'}, {0xe1,0}, {0xce,'I'},
1N/A {0xcf,'C'}, {0xc2,'E'}, {0xce,'E'}, {0xc8,'E'},
1N/A {0xc7,'E'}, {0xc2,'I'}, {0xc3,'I'}, {0xc5,'I'},
1N/A {0xe2,0}, {0xcb,'N'}, {0xc5,'O'}, {0xcb,'K'},
1N/A {0xc3,'O'}, {0xc4,'O'}, {0xc8,'O'}, {0xb4,0},
1N/A {0xe9,0}, {0xce,'U'}, {0xc2,'U'}, {0xc3,'U'},
1N/A {0xc8,'U'}, {0xc4,'U'}, {0xc5,'U'}, {0xfb,0},
1N/A {0xc5,'a'}, {0xc2,'a'}, {0xc3,'a'}, {0xc4,'a'},
1N/A {0xc8,'a'}, {0xca,'a'}, {0xf1,0}, {0xce,'i'},
1N/A {0xcf,'c'}, {0xc2,'e'}, {0xce,'e'}, {0xc8,'e'},
1N/A {0xc7,'e'}, {0xc2,'i'}, {0xc3,'i'}, {0xc5,'i'},
1N/A {0xf2,0}, {0xcb,'n'}, {0xc5,'o'}, {0xcb,'k'},
1N/A {0xc3,'o'}, {0xc4,'o'}, {0xc8,'o'}, {0xb8,0},
1N/A {0xf9,0}, {0xce,'u'}, {0xc2,'u'}, {0xc3,'u'},
1N/A {0xc8,'u'}, {0xc4,'u'}, {0xc5,'u'}, {0xc7,ALONE}
1N/A};
1N/A#elif (ISO_8859 == 9)
1N/Astatic Couple trans_iso8859_t61[96] = {
1N/A {0xa0,0}, {0xa1,0}, {0xa2,0}, {0xa3,0},
1N/A {0xa8,0}, {0xa5,0}, {0xd7,0}, {0xa7,0},
1N/A {0xc8,ALONE}, {0xd3,0}, {0xe3,0}, {0xab,0},
1N/A {0xd6,0}, {0xff,0}, {0xd2,0}, {0xc5,ALONE},
1N/A {0xb0,0}, {0xb1,0}, {0xb2,0}, {0xb3,0},
1N/A {0xc2,ALONE}, {0xb5,0}, {0xb6,0}, {0xb7,0},
1N/A {0xcb,ALONE}, {0xd1,0}, {0xeb,0}, {0xbb,0},
1N/A {0xbc,0}, {0xbd,0}, {0xbe,0}, {0xbf,0},
1N/A {0xc1,'A'}, {0xc2,'A'}, {0xc3,'A'}, {0xc4,'A'},
1N/A {0xc8,'A'}, {0xca,'A'}, {0xe1,0}, {0xcb,'C'},
1N/A {0xc1,'E'}, {0xc2,'E'}, {0xc3,'E'}, {0xc8,'E'},
1N/A {0xc1,'I'}, {0xc2,'I'}, {0xc3,'I'}, {0xc8,'I'},
1N/A {0xc6,'G'}, {0xc4,'N'}, {0xc1,'O'}, {0xc2,'O'},
1N/A {0xc3,'O'}, {0xc4,'O'}, {0xc8,'O'}, {0xb4,0},
1N/A {0xe9,0}, {0xc1,'U'}, {0xc2,'U'}, {0xc3,'U'},
1N/A {0xc8,'U'}, {0xc7,'I'}, {0xcb,'S'}, {0xfb,0},
1N/A {0xc1,'a'}, {0xc2,'a'}, {0xc3,'a'}, {0xc4,'a'},
1N/A {0xc8,'a'}, {0xca,'a'}, {0xf1,0}, {0xcb,'c'},
1N/A {0xc1,'e'}, {0xc2,'e'}, {0xce,'e'}, {0xc8,'e'},
1N/A {0xc7,'e'}, {0xc2,'i'}, {0xc3,'i'}, {0xc5,'i'},
1N/A {0xc6,'g'}, {0xc4,'n'}, {0xc1,'o'}, {0xc2,'o'},
1N/A {0xc3,'o'}, {0xc4,'o'}, {0xc8,'o'}, {0xb8,0},
1N/A {0xf9,0}, {0xc1,'u'}, {0xc2,'u'}, {0xc3,'u'},
1N/A {0xc8,'u'}, {0xf5,0}, {0xcb,'s'}, {0xc8,'y'}
1N/A};
1N/A#elif (ISO_8859 == 10)
1N/Astatic Couple trans_iso8859_t61[96] = {
1N/A {0xa0,0}, {0xce,'A'}, {0xc5,'E'}, {0xcb,'G'},
1N/A {0xc5,'I'}, {0xc4,'I'}, {0xcb,'K'}, {0xa7,0},
1N/A {0xcb,'L'}, {0xe2,0}, {0xcf,'S'}, {0xed,0},
1N/A {0xcf,'Z'}, {0xff,0}, {0xc5,'U'}, {0xee,0},
1N/A {0xb0,0}, {0xce,'a'}, {0xc5,'e'}, {0xcb,'g'},
1N/A {0xc5,'i'}, {0xc4,'i'}, {0xcb,'k'}, {0xb7,0},
1N/A {0xcb,'l'}, {0xf2,0}, {0xcf,'s'}, {0xfd,0},
1N/A {0xcf,'z'}, {0xd0,0}, {0xc5,'u'}, {0xfe,0},
1N/A {0xc5,'A'}, {0xc2,'A'}, {0xc3,'A'}, {0xc4,'A'},
1N/A {0xc8,'A'}, {0xca,'A'}, {0xe1,0}, {0xce,'I'},
1N/A {0xcf,'C'}, {0xc2,'E'}, {0xce,'E'}, {0xc8,'E'},
1N/A {0xc7,'E'}, {0xc2,'I'}, {0xc3,'I'}, {0xc8,'I'},
1N/A {0,0}, {0xcb,'N'}, {0xc5,'O'}, {0xc2,'O'},
1N/A {0xc3,'O'}, {0xc4,'O'}, {0xc8,'O'}, {0xc4,'U'},
1N/A {0xe9,0}, {0xce,'U'}, {0xc2,'U'}, {0xc3,'U'},
1N/A {0xc8,'U'}, {0xc2,'Y'}, {0xec,0}, {0xfb,0},
1N/A {0xc5,'a'}, {0xc2,'a'}, {0xc3,'a'}, {0xc4,'a'},
1N/A {0xc8,'a'}, {0xca,'a'}, {0xf1,0}, {0xce,'i'},
1N/A {0xcf,'c'}, {0xc2,'e'}, {0xce,'e'}, {0xc8,'e'},
1N/A {0xc7,'e'}, {0xc2,'i'}, {0xc3,'i'}, {0xc8,'i'},
1N/A {0xf3,0}, {0xcb,'n'}, {0xc5,'o'}, {0xc2,'o'},
1N/A {0xc3,'o'}, {0xc4,'o'}, {0xc8,'o'}, {0xc4,'u'},
1N/A {0xf9,0}, {0xce,'u'}, {0xc2,'u'}, {0xc3,'u'},
1N/A {0xc8,'u'}, {0xc2,'y'}, {0xfc,0}, {0xf0,0}
1N/A};
1N/A#endif
1N/A
1N/A
1N/Astatic Byte *
1N/Ac_to_hh( Byte *o, Byte c )
1N/A{
1N/A Byte n;
1N/A
1N/A *o++ = '{'; *o++ = 'x';
1N/A n = c >> 4;
1N/A *o++ = ((n < 0xA) ? '0' : 'A' - 0xA) + n;
1N/A n = c & 0x0F;
1N/A *o++ = ((n < 0xA) ? '0' : 'A' - 0xA) + n;
1N/A *o++ = '}';
1N/A return o;
1N/A}
1N/A
1N/A
1N/Astatic Byte *
1N/Ac_to_cc( Byte *o, Couple *cc, Byte c )
1N/A{
1N/A if ( (*cc).a != 0 ) {
1N/A if ( (*cc).b == 0 )
1N/A *o++ = (*cc).a;
1N/A else {
1N/A *o++ = '{';
1N/A *o++ = (*cc).a;
1N/A *o++ = (*cc).b;
1N/A *o++ = '}';
1N/A }
1N/A return o;
1N/A }
1N/A else
1N/A return c_to_hh( o, c );
1N/A}
1N/A
1N/A/* --- routine to convert from T.61 to ISO 8859-n --- */
1N/A
1N/Aint
1N/Aldap_t61_to_8859( char **bufp, unsigned int *buflenp, int free_input )
1N/A{
1N/A Byte *s, *oo, *o;
1N/A unsigned int n;
1N/A int c;
1N/A unsigned int len;
1N/A Couple *cc;
1N/A
1N/A Debug( LDAP_DEBUG_TRACE, catgets(slapdcat, 1, 111, "ldap_t61_to_8859 input length: %ld\n"),
1N/A *buflenp, 0, 0 );
1N/A
1N/A len = *buflenp;
1N/A s = (Byte *) *bufp;
1N/A
1N/A if ( (o = oo = (Byte *)malloc( 2 * len + 64 )) == NULL ) {
1N/A return( 1 );
1N/A }
1N/A
1N/A while ( (char *)s - *(char **)bufp < len ) {
1N/A switch ( *s >> 4 ) {
1N/A
1N/A case 0xA: case 0xB:
1N/A o = c_to_cc( o, &trans_t61a_iso8859[ *s - 0xA0 ], *s );
1N/A s++;
1N/A break;
1N/A
1N/A case 0xD: case 0xE: case 0xF:
1N/A o = c_to_cc( o, &trans_t61b_iso8859[ *s - 0xD0 ], *s );
1N/A s++;
1N/A break;
1N/A
1N/A case 0xC:
1N/A if ( (*s == 0xC0) || (*s == 0xC9) || (*s == 0xCC) ) {
1N/A o = c_to_hh( o, *s++ );
1N/A break;
1N/A }
1N/A
1N/A n = (*s++) - 0xC0;
1N/A switch ( *s ) {
1N/A
1N/A case 'A': c = letter_w_diacritic[n][0]; break;
1N/A case 'C': c = letter_w_diacritic[n][1]; break;
1N/A case 'D': c = letter_w_diacritic[n][2]; break;
1N/A case 'E': c = letter_w_diacritic[n][3]; break;
1N/A case 'G': c = letter_w_diacritic[n][4]; break;
1N/A case 'H': c = letter_w_diacritic[n][5]; break;
1N/A case 'I': c = letter_w_diacritic[n][6]; break;
1N/A case 'J': c = letter_w_diacritic[n][7]; break;
1N/A case 'K': c = letter_w_diacritic[n][8]; break;
1N/A case 'L': c = letter_w_diacritic[n][9]; break;
1N/A case 'N': c = letter_w_diacritic[n][10]; break;
1N/A case 'O': c = letter_w_diacritic[n][11]; break;
1N/A case 'R': c = letter_w_diacritic[n][12]; break;
1N/A case 'S': c = letter_w_diacritic[n][13]; break;
1N/A case 'T': c = letter_w_diacritic[n][14]; break;
1N/A case 'U': c = letter_w_diacritic[n][15]; break;
1N/A case 'W': c = letter_w_diacritic[n][16]; break;
1N/A case 'Y': c = letter_w_diacritic[n][17]; break;
1N/A case 'Z': c = letter_w_diacritic[n][18]; break;
1N/A
1N/A case 'a': c = letter_w_diacritic[n][19]; break;
1N/A case 'c': c = letter_w_diacritic[n][20]; break;
1N/A case 'd': c = letter_w_diacritic[n][21]; break;
1N/A case 'e': c = letter_w_diacritic[n][22]; break;
1N/A case 'g': c = letter_w_diacritic[n][23]; break;
1N/A case 'h': c = letter_w_diacritic[n][24]; break;
1N/A case 'i': c = letter_w_diacritic[n][25]; break;
1N/A case 'j': c = letter_w_diacritic[n][26]; break;
1N/A case 'k': c = letter_w_diacritic[n][27]; break;
1N/A case 'l': c = letter_w_diacritic[n][28]; break;
1N/A case 'n': c = letter_w_diacritic[n][29]; break;
1N/A case 'o': c = letter_w_diacritic[n][30]; break;
1N/A case 'r': c = letter_w_diacritic[n][31]; break;
1N/A case 's': c = letter_w_diacritic[n][32]; break;
1N/A case 't': c = letter_w_diacritic[n][33]; break;
1N/A case 'u': c = letter_w_diacritic[n][34]; break;
1N/A case 'w': c = letter_w_diacritic[n][35]; break;
1N/A case 'y': c = letter_w_diacritic[n][36]; break;
1N/A case 'z': c = letter_w_diacritic[n][37]; break;
1N/A
1N/A case ALONE: c = (( !diacritic[n].b ) ? diacritic[n].a : -1);
1N/A break;
1N/A
1N/A default: c = 0;
1N/A }
1N/A
1N/A if ( c > 0 ) {
1N/A *o++ = c; s++;
1N/A } else {
1N/A *o++ = '{';
1N/A if ( c == -1 ) {
1N/A *o++ = ( ( *s == ALONE ) ? ' ' : *s );
1N/A s++;
1N/A } else {
1N/A *o++ = '"';
1N/A }
1N/A *o++ = diacritic[n].a;
1N/A *o++ = '}';
1N/A }
1N/A break;
1N/A
1N/A#if (ISO_8859 == 0)
1N/A case 0x8: case 0x9:
1N/A *o++ = 0x1B; /* <ESC> */
1N/A *o++ = *s++ - 0x40;
1N/A break;
1N/A#endif
1N/A
1N/A default:
1N/A *o++ = *s++;
1N/A }
1N/A }
1N/A
1N/A len = o - oo;
1N/A o = oo;
1N/A
1N/A if ( (oo = (Byte *)realloc( o, len )) == NULL ) {
1N/A free( o );
1N/A return( 1 );
1N/A }
1N/A
1N/A if ( free_input ) {
1N/A free( *bufp );
1N/A }
1N/A *bufp = (char *) oo;
1N/A *buflenp = len;
1N/A return( 0 );
1N/A}
1N/A
1N/A
1N/Astatic int
1N/Ahh_to_c( Byte *h )
1N/A{
1N/A Byte c;
1N/A
1N/A if ( (*h >= '0') && (*h <= '9') ) c = *h++ - '0';
1N/A else if ( (*h >= 'A') && (*h <= 'F') ) c = *h++ - 'A' + 10;
1N/A else if ( (*h >= 'a') && (*h <= 'f') ) c = *h++ - 'a' + 10;
1N/A else return -1;
1N/A
1N/A c <<= 4;
1N/A
1N/A if ( (*h >= '0') && (*h <= '9') ) c |= *h - '0';
1N/A else if ( (*h >= 'A') && (*h <= 'F') ) c |= *h - 'A' + 10;
1N/A else if ( (*h >= 'a') && (*h <= 'f') ) c |= *h - 'a' + 10;
1N/A else return -1;
1N/A
1N/A return c;
1N/A}
1N/A
1N/A
1N/Astatic Byte *
1N/Acc_to_t61( Byte *o, Byte *s )
1N/A{
1N/A int n, c = 0;
1N/A
1N/A switch ( *(s + 1) ) {
1N/A
1N/A case '`': c = -1; break; /* <grave-accent> */
1N/A
1N/A case '!':
1N/A switch ( *s ) {
1N/A case '!': c = 0x7C; break; /* <vertical-line> */
1N/A case '(': c = 0x7B; break; /* <left-curly-bracket> */
1N/A case '-': c = 0xAD; break; /* <upwards-arrow> */
1N/A default: c = -1; /* <grave-accent> */
1N/A }
1N/A break;
1N/A
1N/A#if (ISO_8859 == 1) || (ISO_8859 == 2) || (ISO_8859 == 3) || \
1N/A (ISO_8859 == 4) || (ISO_8859 == 9)
1N/A case 0xB4:
1N/A#endif
1N/A case '\'': c = -2; break; /* <acute-accent> */
1N/A
1N/A case '^': c = -3; break; /* <circumflex-acent> */
1N/A
1N/A case '>':
1N/A switch ( *s ) {
1N/A case ')': c = 0x5D; break; /* <right-square-bracket> */
1N/A case '>': c = 0xBB; break; /* <right-angle-quotation> */
1N/A case '-': c = 0xAE; break; /* <rightwards-arrow> */
1N/A default: c = -3; /* <circumflex-acent> */
1N/A }
1N/A break;
1N/A
1N/A case '~':
1N/A case '?': c = -4; break; /* <tilde> */
1N/A
1N/A#if (ISO_8859 == 1) || (ISO_8859 == 4) || (ISO_8859 == 9)
1N/A case 0xAF: c = -5; break; /* <macron> */
1N/A#endif
1N/A
1N/A case '-':
1N/A switch ( *s ) {
1N/A case '-': c = 0xFF; break; /* <soft-hyphen> */
1N/A case '<': c = 0xAC; break; /* <leftwards arrow> */
1N/A case '+': c = 0xB1; break; /* <plus-minus> */
1N/A case 'd': c = 0xF3; break; /* <eth> */
1N/A default: c = -5; /* <macron> */
1N/A }
1N/A break;
1N/A
1N/A#if (ISO_8859 == 2) || (ISO_8859 == 3)
1N/A case 0xA2: c = -6; break; /* <breve> */
1N/A#endif
1N/A
1N/A case '(':
1N/A if ( *s == '<' ) c = 0x5B; /* <left-square-bracket> */
1N/A else c = -6; /* <breve> */
1N/A break;
1N/A
1N/A#if (ISO_8859 == 2) || (ISO_8859 == 3) || (ISO_8859 == 4)
1N/A case 0xFF: c = -7; break; /* <dot-accent> */
1N/A#endif
1N/A
1N/A case '.':
1N/A switch ( *s ) {
1N/A case 'i': c = 0xF5; break; /* <dotless-i> */
1N/A case 'L': c = 0xE7; break; /* <L-middle-dot> */
1N/A case 'l': c = 0xF7; break; /* <l-middle-dot> */
1N/A default: c = -7; /* <dot-accent> */
1N/A }
1N/A break;
1N/A
1N/A#if (ISO_8859 == 1) || (ISO_8859 == 2) || (ISO_8859 == 3) || \
1N/A (ISO_8859 == 4) || (ISO_8859 == 9)
1N/A case 0xA8: c = -8; break; /* <diaeresis> */
1N/A#endif
1N/A
1N/A case ':':
1N/A if ( *s == '-') c = 0xB8; /* <division-sign> */
1N/A else c = -8; /* <diaeresis> */
1N/A break;
1N/A
1N/A#if (ISO_8859 == 1) || (ISO_8859 == 2) || (ISO_8859 == 3) || \
1N/A (ISO_8859 == 4) || (ISO_8859 == 9) || (ISO_8859 == 10)
1N/A case 0xB0:
1N/A#endif
1N/A case '0': c = -10; break; /* <ring-above> */
1N/A
1N/A#if (ISO_8859 == 1) || (ISO_8859 == 2) || (ISO_8859 == 3) || \
1N/A (ISO_8859 == 4) || (ISO_8859 == 9)
1N/A case 0xB8:
1N/A#endif
1N/A case ',': c = -11; break; /* <cedilla> */
1N/A
1N/A#if (ISO_8859 == 2)
1N/A case 0xBD:
1N/A#endif
1N/A case '"': c = -13; break; /* <double-acute-accent> */
1N/A
1N/A#if (ISO_8859 == 2) || (ISO_8859 == 4)
1N/A case 0xB2:
1N/A#endif
1N/A case ';': c = -14; break; /* <ogonek> */
1N/A
1N/A#if (ISO_8859 == 2) || (ISO_8859 == 4)
1N/A case 0xB7: c = -15; break; /* <caron> */
1N/A#endif
1N/A
1N/A case ')':
1N/A if ( *s == '!' ) c = 0x7D; /* <left-curly-bracket> */
1N/A break;
1N/A
1N/A case '<':
1N/A if ( *s == '<' ) c = 0xAB; /* <left-angle-quotation> */
1N/A else c = -15; /* <caron> */
1N/A break;
1N/A
1N/A case '/':
1N/A switch ( *s ) {
1N/A case '/': c = 0x5C; break; /* <reverse-solidus> */
1N/A case 'D': c = 0xE2; break; /* <D-stroke> */
1N/A case 'd': c = 0xF2; break; /* <d-stroke> */
1N/A case 'H': c = 0xE4; break; /* <H-stroke> */
1N/A case 'h': c = 0xF4; break; /* <h-stroke> */
1N/A case 'L': c = 0xE8; break; /* <L-stroke> */
1N/A case 'l': c = 0xF8; break; /* <l-stroke> */
1N/A case 'O': c = 0xE9; break; /* <O-stroke> */
1N/A case 'o': c = 0xF9; break; /* <o-stroke> */
1N/A case 'T': c = 0xED; break; /* <T-stroke> */
1N/A case 't': c = 0xFD; break; /* <t-stroke> */
1N/A }
1N/A break;
1N/A
1N/A case '2':
1N/A if ( *s == '1' ) c = 0xBD; /* <one-half> */
1N/A break;
1N/A
1N/A case '4':
1N/A switch ( *s ) {
1N/A case '1': c = 0xBC; break; /* <one-quarter> */
1N/A case '3': c = 0xBE; break; /* <three-quarters> */
1N/A }
1N/A break;
1N/A
1N/A case '6':
1N/A switch ( *s ) {
1N/A case '\'': c = 0xA9; break; /* <left-single-quotation> */
1N/A case '"': c = 0xAA; break; /* <left-double-quotation> */
1N/A }
1N/A break;
1N/A
1N/A case '8':
1N/A switch ( *s ) {
1N/A case '1': c = 0xDC; break; /* <one-eighth> */
1N/A case '3': c = 0xDD; break; /* <three-eighths> */
1N/A case '5': c = 0xDE; break; /* <five-eighths> */
1N/A case '7': c = 0xDF; break; /* <seven-eighths> */
1N/A case 'M': c = 0xD5; break; /* <eighth-note> */
1N/A }
1N/A break;
1N/A
1N/A case '9':
1N/A switch ( *s ) {
1N/A case '\'': c = 0xB9; break; /* <right-single-quotation> */
1N/A case '"': c = 0xBA; break; /* <right-double-quotation> */
1N/A }
1N/A break;
1N/A
1N/A case 'A':
1N/A if ( *s == 'A' ) c = -10; /* <ring-above> + <A> */
1N/A break;
1N/A
1N/A case 'a':
1N/A switch ( *s ) {
1N/A case '-': c = 0xE3; break; /* <femenine-ordinal-a> */
1N/A case 'a': c = -10; break; /* <ring-above> + <a> */
1N/A }
1N/A break;
1N/A
1N/A case 'B':
1N/A if ( *s == 'B' ) c = 0xD7; /* <broken-bar> */
1N/A break;
1N/A
1N/A case 'b':
1N/A if ( *s == 'N' ) c = 0xA6; /* <number-sign> */
1N/A break;
1N/A
1N/A case 'd':
1N/A if ( *s == 'P' ) c = 0xA3; /* <pound-sign> */
1N/A break;
1N/A
1N/A case 'E':
1N/A switch ( *s ) {
1N/A case 'S': c = 0xA7; break; /* <section-sign> */
1N/A case 'A': c = 0xE1; break; /* <AE> */
1N/A case 'O': c = 0xEA; break; /* <OE> */
1N/A }
1N/A break;
1N/A
1N/A case 'e':
1N/A switch ( *s ) {
1N/A case 'a': c = 0xF1; break; /* <ae> */
1N/A case 'o': c = 0xFA; break; /* <oe> */
1N/A case 'Y': c = 0xA5; break; /* <yen-sign> */
1N/A }
1N/A break;
1N/A
1N/A case 'G':
1N/A switch ( *s ) {
1N/A case 'D': c = 0xB0; break; /* <degree-sign> */
1N/A case 'N': c = 0xEE; break; /* <Eng> */
1N/A }
1N/A break;
1N/A
1N/A case 'g':
1N/A switch ( *s ) {
1N/A case 'R': c = 0xD2; break; /* <registered-sign> */
1N/A case 'n': c = 0xFE; break; /* <eng> */
1N/A }
1N/A break;
1N/A
1N/A case 'H':
1N/A if ( *s == 'T' ) c = 0xEC; /* <Thorn> */
1N/A break;
1N/A
1N/A case 'h':
1N/A if ( *s == 't' ) c = 0xFC; /* <thorn> */
1N/A break;
1N/A
1N/A case 'I':
1N/A switch ( *s ) {
1N/A case 'P': c = 0xB6; break; /* <pilcrow-sign> */
1N/A case '!': c = 0xA1; break; /* <inverted-exclamation> */
1N/A case '?': c = 0xBF; break; /* <inverted-question> */
1N/A }
1N/A break;
1N/A
1N/A case 'J':
1N/A if ( *s == 'I' ) c = 0xE6; /* <IJ> */
1N/A break;
1N/A
1N/A case 'j':
1N/A if ( *s == 'i' ) c = 0xF6; /* <ij> */
1N/A break;
1N/A
1N/A case 'k':
1N/A if ( *s == 'k' ) c = 0xF0; /* <kra> */
1N/A break;
1N/A
1N/A case 'M':
1N/A switch ( *s ) {
1N/A case '.': c = 0xB7; break; /* <middle-dot> */
1N/A case '-': c = 0xD0; break; /* <em-dash> */
1N/A case 'T': c = 0xD4; break; /* <trade-mark-sign> */
1N/A }
1N/A break;
1N/A
1N/A case 'm':
1N/A switch ( *s ) {
1N/A case '\'': /* <macron> RFC 1345 */
1N/A case ' ': c = -5; break; /* <macron> */
1N/A case 'O': c = 0xE0; break; /* <Ohm sign> */
1N/A }
1N/A break;
1N/A
1N/A case 'n':
1N/A if ( *s == '\'' ) c = 0xEF; /* <n-preceded-by-apostrophe> */
1N/A break;
1N/A
1N/A case 'O':
1N/A switch ( *s ) {
1N/A case 'D': c = 0xA4; break; /* <dollar-sign> */
1N/A case 'N': c = 0xD6; break; /* <not-sign> */
1N/A }
1N/A break;
1N/A
1N/A case 'o':
1N/A switch ( *s ) {
1N/A case 'C': c = 0xD3; break; /* <copyright-sign> */
1N/A case '-': c = 0xEB; break; /* <masculine-ordinal-o> */
1N/A }
1N/A break;
1N/A
1N/A case 'S':
1N/A switch ( *s ) {
1N/A case '1': c = 0xD1; break; /* <superscript-1> */
1N/A case '2': c = 0xB2; break; /* <superscript-2> */
1N/A case '3': c = 0xB3; break; /* <superscript-3> */
1N/A case 'N': c = 0xA0; break; /* <no-break-space> */
1N/A }
1N/A break;
1N/A
1N/A case 's':
1N/A if ( *s == 's' ) c = 0xFB; /* <sharp-s> */
1N/A break;
1N/A
1N/A case 't':
1N/A if ( *s == 'C' ) c = 0xA2; /* <cent-sign> */
1N/A break;
1N/A
1N/A case 'u':
1N/A if ( *s == 'C' ) c = 0xA8; /* <currency-sign> */
1N/A break;
1N/A
1N/A case 'v':
1N/A if ( *s == '-' ) c = 0xAF; /* <downwards-arrow> */
1N/A break;
1N/A
1N/A case 'X':
1N/A if ( *s == '*' ) c = 0xB4; /* <multiplication-sign> */
1N/A break;
1N/A
1N/A case 'y':
1N/A if ( *s == 'M' ) c = 0xB5; /* <micro-sign> */
1N/A break;
1N/A }
1N/A
1N/A if ( c > 0 ) {
1N/A *o++ = c;
1N/A return o;
1N/A } else if ( !c )
1N/A return NULL;
1N/A
1N/A /* else: c < 0 */
1N/A n = -c;
1N/A switch ( *s ) {
1N/A
1N/A case 'A': c = letter_w_diacritic[n][0]; break;
1N/A case 'C': c = letter_w_diacritic[n][1]; break;
1N/A case 'D': c = letter_w_diacritic[n][2]; break;
1N/A case 'E': c = letter_w_diacritic[n][3]; break;
1N/A case 'G': c = letter_w_diacritic[n][4]; break;
1N/A case 'H': c = letter_w_diacritic[n][5]; break;
1N/A case 'I': c = letter_w_diacritic[n][6]; break;
1N/A case 'J': c = letter_w_diacritic[n][7]; break;
1N/A case 'K': c = letter_w_diacritic[n][8]; break;
1N/A case 'L': c = letter_w_diacritic[n][9]; break;
1N/A case 'N': c = letter_w_diacritic[n][10]; break;
1N/A case 'O': c = letter_w_diacritic[n][11]; break;
1N/A case 'R': c = letter_w_diacritic[n][12]; break;
1N/A case 'S': c = letter_w_diacritic[n][13]; break;
1N/A case 'T': c = letter_w_diacritic[n][14]; break;
1N/A case 'U': c = letter_w_diacritic[n][15]; break;
1N/A case 'W': c = letter_w_diacritic[n][16]; break;
1N/A case 'Y': c = letter_w_diacritic[n][17]; break;
1N/A case 'Z': c = letter_w_diacritic[n][18]; break;
1N/A
1N/A case 'a': c = letter_w_diacritic[n][19]; break;
1N/A case 'c': c = letter_w_diacritic[n][20]; break;
1N/A case 'd': c = letter_w_diacritic[n][21]; break;
1N/A case 'e': c = letter_w_diacritic[n][22]; break;
1N/A case 'g': c = letter_w_diacritic[n][23]; break;
1N/A case 'h': c = letter_w_diacritic[n][24]; break;
1N/A case 'i': c = letter_w_diacritic[n][25]; break;
1N/A case 'j': c = letter_w_diacritic[n][26]; break;
1N/A case 'k': c = letter_w_diacritic[n][27]; break;
1N/A case 'l': c = letter_w_diacritic[n][28]; break;
1N/A case 'n': c = letter_w_diacritic[n][29]; break;
1N/A case 'o': c = letter_w_diacritic[n][30]; break;
1N/A case 'r': c = letter_w_diacritic[n][31]; break;
1N/A case 's': c = letter_w_diacritic[n][32]; break;
1N/A case 't': c = letter_w_diacritic[n][33]; break;
1N/A case 'u': c = letter_w_diacritic[n][34]; break;
1N/A case 'w': c = letter_w_diacritic[n][35]; break;
1N/A case 'y': c = letter_w_diacritic[n][36]; break;
1N/A case 'z': c = letter_w_diacritic[n][37]; break;
1N/A
1N/A case '\'':
1N/A case ' ': c = -1; break;
1N/A
1N/A default: c = 0;
1N/A }
1N/A
1N/A if ( !c )
1N/A return NULL;
1N/A
1N/A *o++ = n + 0xC0;
1N/A *o++ = ( ( (*s == ' ') || (*s == '\'') ) ? ALONE : *s );
1N/A return o;
1N/A}
1N/A
1N/A
1N/A/* --- routine to convert from ISO 8859-n to T.61 --- */
1N/A
1N/Aint
1N/Aldap_8859_to_t61( char **bufp, unsigned int *buflenp, int free_input )
1N/A{
1N/A Byte *s, *oo, *o, *aux;
1N/A int c;
1N/A unsigned int len;
1N/A Couple *cc;
1N/A
1N/A Debug( LDAP_DEBUG_TRACE, catgets(slapdcat, 1, 112, "ldap_8859_to_t61 input length: %ld\n"),
1N/A *buflenp, 0, 0 );
1N/A
1N/A len = *buflenp;
1N/A s = (Byte *) *bufp;
1N/A
1N/A if ( (o = oo = (Byte *)malloc( 2 * len + 64 )) == NULL ) {
1N/A return( 1 );
1N/A }
1N/A
1N/A while ( (char *)s - *(char **)bufp < len ) {
1N/A switch( *s >> 5 ) {
1N/A
1N/A case 2:
1N/A switch ( *s ) {
1N/A
1N/A case '^': *o++ = 0xC3; *o++ = ALONE; s++; break;
1N/A
1N/A case '\\':
1N/A s++;
1N/A if ( (c = hh_to_c( s )) != -1 ) {
1N/A *o++ = c;
1N/A s += 2;
1N/A } else
1N/A *o++ = '\\';
1N/A break;
1N/A
1N/A default: *o++ = *s++;
1N/A }
1N/A break;
1N/A
1N/A case 3:
1N/A switch ( *s ) {
1N/A
1N/A case '`': *o++ = 0xC1; *o++ = ALONE; s++; break;
1N/A case '~': *o++ = 0xC4; *o++ = ALONE; s++; break;
1N/A
1N/A case '{':
1N/A s++;
1N/A if ( *(s + 2) == '}' ) {
1N/A if ( (aux = cc_to_t61( o, s )) != NULL ) {
1N/A o = aux;
1N/A s += 3;
1N/A } else {
1N/A *o++ = '{';
1N/A }
1N/A } else if ( (*(s + 3) == '}') && ( (*s == 'x') || (*s == 'X') ) &&
1N/A ( (c = hh_to_c( s + 1 )) != -1 ) ) {
1N/A *o++ = c;
1N/A s += 4;
1N/A } else {
1N/A *o++ = '{';
1N/A }
1N/A break;
1N/A
1N/A default:
1N/A *o++ = *s++;
1N/A }
1N/A break;
1N/A
1N/A#if (ISO_8859 == 0)
1N/A case 4: case 5: case 6: case 7:
1N/A s++;
1N/A break;
1N/A#else
1N/A case 5: case 6: case 7:
1N/A# if (ISO_8859 == 1) || (ISO_8859 == 2) || (ISO_8859 == 3) || \
1N/A (ISO_8859 == 4) || (ISO_8859 == 9) || (ISO_8859 == 10)
1N/A if ( (*(cc = &trans_iso8859_t61[ *s - 0xA0 ])).a ) {
1N/A *o++ = (*cc).a;
1N/A if ( (*cc).b ) *o++ = (*cc).b;
1N/A }
1N/A# endif
1N/A s++;
1N/A break;
1N/A#endif
1N/A
1N/A default:
1N/A *o++ = *s++;
1N/A }
1N/A }
1N/A
1N/A len = o - oo;
1N/A o = oo;
1N/A
1N/A if ( (oo = (Byte *)realloc( o, len )) == NULL ) {
1N/A free( o );
1N/A return( 1 );
1N/A }
1N/A
1N/A if ( free_input ) {
1N/A free( *bufp );
1N/A }
1N/A *bufp = (char *) oo;
1N/A *buflenp = len;
1N/A return( 0 );
1N/A}
1N/A
1N/A
1N/A#ifdef NOT_NEEDED_IN_LIBLDAP /* mcs@umich.edu 12 Oct 1995 */
1N/A/* --- routine to convert "escaped" (\hh) characters to 8bits --- */
1N/A
1N/Avoid convert_escaped_to_8bit( s )
1N/Achar *s;
1N/A{
1N/A char *o = s;
1N/A int c;
1N/A
1N/A while ( *s ) {
1N/A if ( *s == '\\' ) {
1N/A if ( (c = hh_to_c( ++s )) != -1 ) {
1N/A *o++ = c;
1N/A s += 2;
1N/A } else
1N/A *o++ = '\\';
1N/A } else
1N/A *o++ = *s++;
1N/A }
1N/A *o = '\0';
1N/A}
1N/A
1N/A/* --- routine to convert 8bits characters to the "escaped" (\hh) form --- */
1N/A
1N/Achar *convert_8bit_to_escaped( s )
1N/AByte *s;
1N/A{
1N/A Byte *o, *oo;
1N/A Byte n;
1N/A
1N/A if ( (o = oo = (Byte *)malloc( 2 * strlen( s ) + 64 )) == NULL ) {
1N/A return( NULL );
1N/A }
1N/A
1N/A while ( *s ) {
1N/A if ( *s < 0x80 )
1N/A *o++ = *s++;
1N/A else {
1N/A *o++ = '\\';
1N/A n = *s >> 4;
1N/A *o++ = ((n < 0xA) ? '0' : 'A' - 0xA) + n;
1N/A n = *s++ & 0x0F;
1N/A *o++ = ((n < 0xA) ? '0' : 'A' - 0xA) + n;
1N/A }
1N/A }
1N/A *o = '\0';
1N/A
1N/A o = oo;
1N/A
1N/A if ( (oo = (Byte *)realloc( o, strlen( o ) + 1 )) == NULL ) {
1N/A free( o );
1N/A return( NULL );
1N/A }
1N/A
1N/A return( (char *)oo );
1N/A}
1N/A
1N/A/* --- routine to convert from T.61 to printable characters --- */
1N/A
1N/A/*
1N/A printable characters [RFC 1488]: 'A'..'Z', 'a'..'z', '0'..'9',
1N/A '\'', '(', ')', '+', ',', '-', '.', '/', ':', '?, ' '.
1N/A
1N/A that conversion is language dependent.
1N/A*/
1N/A
1N/Astatic Couple last_t61_printabled[32] = {
1N/A {0,0}, {'A','E'}, {'D',0}, {0,0},
1N/A {'H',0}, {0,0}, {'I','J'}, {'L',0},
1N/A {'L',0}, {'O',0}, {'O','E'}, {0,0},
1N/A {'T','H'}, {'T',0}, {'N','G'}, {'n',0},
1N/A {'k',0}, {'a','e'}, {'d',0}, {'d',0},
1N/A {'h',0}, {'i',0}, {'i','j'}, {'l',0},
1N/A {'l',0}, {'o',0}, {'o','e'}, {'s','s'},
1N/A {'t','h'}, {'t',0}, {'n','g'}, {0,0}
1N/A};
1N/A
1N/Achar *t61_printable( s )
1N/AByte *s;
1N/A{
1N/A Byte *o, *oo;
1N/A Byte n;
1N/A Couple *cc;
1N/A
1N/A if ( (o = oo = (Byte *)malloc( 2 * strlen( s ) + 64 )) == NULL ) {
1N/A return( NULL );
1N/A }
1N/A
1N/A while ( *s ) {
1N/A if ( ( (*s >= 'A') && (*s <= 'Z') ) ||
1N/A ( (*s >= 'a') && (*s <= 'z') ) ||
1N/A ( (*s >= '0') && (*s <= '9') ) ||
1N/A ( (*s >= '\'') && (*s <= ')') ) ||
1N/A ( (*s >= '+') && (*s <= '/') ) ||
1N/A ( *s == '?' ) || ( *s == ' ' ) )
1N/A *o++ = *s++;
1N/A else {
1N/A if ( *s >= 0xE0 ) {
1N/A if ( (*(cc = &last_t61_printabled[ *s - 0xE0 ])).a ) {
1N/A *o++ = (*cc).a;
1N/A if ( (*cc).b ) *o++ = (*cc).b;
1N/A }
1N/A }
1N/A else if ( (*s >> 4) == 0xC ) {
1N/A switch ( *s ) {
1N/A case 0xCA: /* ring */
1N/A switch ( *(s + 1) ) {
1N/A case 'A': *o++ = 'A'; *o++ = 'A'; s++; break; /* Swedish */
1N/A case 'a': *o++ = 'a'; *o++ = 'a'; s++; break; /* Swedish */
1N/A }
1N/A break;
1N/A
1N/A case 0xC8: /* diaeresis */
1N/A switch ( *(s + 1) ) {
1N/A case 'Y': *o++ = 'I'; *o++ = 'J'; s++; break; /* Dutch */
1N/A case 'y': *o++ = 'i'; *o++ = 'j'; s++; break; /* Dutch */
1N/A }
1N/A break;
1N/A }
1N/A }
1N/A s++;
1N/A }
1N/A }
1N/A *o = '\0';
1N/A
1N/A o = oo;
1N/A
1N/A if ( (oo = (Byte *)realloc( o, strlen( o ) + 1 )) == NULL ) {
1N/A free( o );
1N/A return( NULL );
1N/A }
1N/A
1N/A return( (char *)oo );
1N/A}
1N/A#endif /* NOT_NEEDED_IN_LIBLDAP */ /* mcs@umich.edu 12 Oct 1995 */
1N/A
1N/A#endif /* LDAP_CHARSET_8859 */
1N/A#endif /* STR_TRANSLATION */