1 /****************************************************************************** 2 / 3 / File: UTF8.h 4 / 5 / Description: UTF-8 conversion functions. 6 / 7 / Copyright 1993-98, Be Incorporated 8 / 9 ******************************************************************************/ 10 11 12 #ifndef _UTF8_H 13 #define _UTF8_H 14 15 #include <BeBuild.h> 16 #include <InterfaceDefs.h> 17 #include <SupportDefs.h> 18 19 /*------------------------------------------------------------*/ 20 /*------- Conversion Flavors ---------------------------------*/ 21 enum { 22 B_ISO1_CONVERSION, /* ISO 8859-1 */ 23 B_ISO2_CONVERSION, /* ISO 8859-2 */ 24 B_ISO3_CONVERSION, /* ISO 8859-3 */ 25 B_ISO4_CONVERSION, /* ISO 8859-4 */ 26 B_ISO5_CONVERSION, /* ISO 8859-5 */ 27 B_ISO6_CONVERSION, /* ISO 8859-6 */ 28 B_ISO7_CONVERSION, /* ISO 8859-7 */ 29 B_ISO8_CONVERSION, /* ISO 8859-8 */ 30 B_ISO9_CONVERSION, /* ISO 8859-9 */ 31 B_ISO10_CONVERSION, /* ISO 8859-10 */ 32 B_MAC_ROMAN_CONVERSION, /* Macintosh Roman */ 33 B_SJIS_CONVERSION, /* Shift-JIS */ 34 B_EUC_CONVERSION, /* EUC Packed Japanese */ 35 B_JIS_CONVERSION, /* JIS X 0208-1990 */ 36 B_MS_WINDOWS_CONVERSION, /* MS-Windows Codepage 1252 */ 37 B_UNICODE_CONVERSION, /* Unicode 2.0 */ 38 B_KOI8R_CONVERSION, /* KOI8-R */ 39 B_MS_WINDOWS_1251_CONVERSION, /* MS-Windows Codepage 1251 */ 40 B_MS_DOS_866_CONVERSION, /* MS-DOS Codepage 866 */ 41 B_MS_DOS_CONVERSION, /* MS-DOS Codepage 437 */ 42 B_EUC_KR_CONVERSION, /* EUC Korean */ 43 B_ISO13_CONVERSION, /* ISO 8859-13 */ 44 B_ISO14_CONVERSION, /* ISO 8859-14 */ 45 B_ISO15_CONVERSION, /* ISO 8859-15 */ 46 }; 47 48 /*-------------------------------------------------------------*/ 49 /*------- Conversion Functions --------------------------------*/ 50 51 _IMPEXP_TEXTENCODING status_t convert_to_utf8(uint32 srcEncoding, 52 const char *src, 53 int32 *srcLen, 54 char *dst, 55 int32 *dstLen, 56 int32 *state, 57 char substitute = B_SUBSTITUTE); 58 59 _IMPEXP_TEXTENCODING status_t convert_from_utf8(uint32 dstEncoding, 60 const char *src, 61 int32 *srcLen, 62 char *dst, 63 int32 *dstLen, 64 int32 *state, 65 char substitute = B_SUBSTITUTE); 66 67 /*-------------------------------------------------------------*/ 68 /*-------------------------------------------------------------*/ 69 70 #endif /* _UTF8_H */ 71