2003-02-20 16:47:23 +01:00
|
|
|
/*
|
|
|
|
* PROGRAM: InterBase International support
|
2003-12-11 11:33:30 +01:00
|
|
|
* MODULE: cv_ksc.h
|
2003-02-20 16:47:23 +01:00
|
|
|
* DESCRIPTION: Codeset conversion for KSC-5601 codesets
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Interbase Public
|
|
|
|
* License Version 1.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy
|
|
|
|
* of the License at http://www.Inprise.com/IPL.html
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an
|
|
|
|
* "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
|
|
|
|
* or implied. See the License for the specific language governing
|
|
|
|
* rights and limitations under the License.
|
|
|
|
*
|
|
|
|
* The Original Code was created by Inprise Corporation
|
|
|
|
* and its predecessors. Portions created by Inprise Corporation are
|
|
|
|
* Copyright (C) Inprise Corporation.
|
|
|
|
*
|
|
|
|
* All Rights Reserved.
|
|
|
|
* Contributor(s): ______________________________________.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* KSC-5601 -> unicode
|
|
|
|
* % KSC-5601 is same to EUC cs1(codeset 1). Then converting
|
|
|
|
* KSC-5601 to EUC is not needed.
|
|
|
|
*/
|
|
|
|
|
2003-12-11 11:33:30 +01:00
|
|
|
/* These macros have a duplicate in lc_ksc.cpp */
|
2003-02-20 16:47:23 +01:00
|
|
|
#define KSC1(uc) ((uc) & 0x80)
|
|
|
|
#define KSC2(uc) ((uc) >= 0x41)
|
|
|
|
|
|
|
|
#define GEN_HAN(b1, b2) ((0xb0 <= (b1) && (b1) <= 0xc8) && (0xa1 <= (b2) && (b2) <= 0xfe))
|
|
|
|
|
|
|
|
#define SPE_HAN(b1, b2) (((b1) == 0xa4) && (((b2) == 0xa2) || ((b2) == 0xa4) || ((b2) == 0xa7) || ((b2) == 0xa8) || ((b2) == 0xa9) || ((b2) == 0xb1) || ((b2) == 0xb2) || ((b2) == 0xb3) || ((b2) == 0xb5) || ((b2) == 0xb6) || ((b2) == 0xb7) || ((b2) == 0xb8) || ((b2) == 0xb9) || ((b2) == 0xba) || ((b2) == 0xbb) || ((b2) == 0xbc) || ((b2) == 0xbd) || ((b2) == 0xbe)))
|
|
|
|
|
2004-03-11 06:04:26 +01:00
|
|
|
USHORT CVKSC_ksc_to_unicode(csconvert* obj, USHORT *dest_ptr, USHORT dest_len,
|
2004-03-07 08:58:55 +01:00
|
|
|
const UCHAR* ksc_str, USHORT ksc_len,
|
2003-02-20 16:47:23 +01:00
|
|
|
SSHORT *err_code, USHORT *err_position);
|
|
|
|
|
2004-03-11 06:04:26 +01:00
|
|
|
USHORT CVKSC_unicode_to_ksc(csconvert* obj, UCHAR *ksc_str, USHORT ksc_len,
|
2004-03-07 08:58:55 +01:00
|
|
|
const USHORT* unicode_str,
|
|
|
|
USHORT unicode_len, SSHORT *err_code, USHORT *err_position);
|
2003-02-20 16:47:23 +01:00
|
|
|
|
2004-03-07 08:58:55 +01:00
|
|
|
USHORT CVKSC_check_ksc(const UCHAR* ksc_str, USHORT ksc_len);
|
2003-02-20 16:47:23 +01:00
|
|
|
|
2004-03-07 08:58:55 +01:00
|
|
|
USHORT CVKSC_ksc_byte2short(TEXTTYPE obj, USHORT *dst, USHORT dst_len,
|
|
|
|
const UCHAR* src, USHORT src_len,
|
|
|
|
SSHORT *err_code, USHORT *err_position);
|
2003-02-20 16:47:23 +01:00
|
|
|
|
2004-03-07 08:58:55 +01:00
|
|
|
SSHORT CVKSC_ksc_mbtowc(TEXTTYPE obj, UCS2_CHAR* wc, const UCHAR* src, USHORT src_len);
|
2003-12-11 11:33:30 +01:00
|
|
|
|