2 ** Copyright 2000-2003 Double Precision, Inc.
3 ** See COPYING for distribution information.
5 ** $Id: ibm864convert.c,v 1.2 2003/03/07 00:47:31 mrsam Exp $
8 #include "unicode_config.h"
13 /* IBM864 has this pesky 0x25 mapping charsets all share the same functions */
15 unicode_char
*unicode_ibm864_c2u(const char *str
, int *err
,
16 const unicode_char
*table
)
19 unicode_char
*p
=(unicode_char
*)malloc((l
+1) * sizeof(unicode_char
));
27 for (l
=0; str
[l
]; l
++)
29 unicode_char c
=table
[(unsigned char)str
[l
]];
39 c
=(int)(unsigned char)str
[l
];
48 char *unicode_ibm864_u2c(const unicode_char
*uc
, int *errflag
,
49 const unicode_char
*tab
)
57 if (errflag
) *errflag
= -1;
65 unicode_char ucc
=uc
[l
];
69 if (tab
[ ucc
& 0xFF ] == uc
[l
])