00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * Rafal Jaroszkiewicz 00008 * Side Effects Software Inc 00009 * 123 Front Street West, Suite 1401 00010 * Toronto, Ontario 00011 * Canada M5J 2M2 00012 * 416-504-9876 00013 * 00014 * NAME: UT_CharSetUtils.h (UT Library, C++) 00015 * 00016 * COMMENTS: 00017 * Utilities for encoding, decoding, and converting text 00018 * from, to, and between character sets and other encodings. 00019 */ 00020 00021 #ifndef __UT_CharSetUtils__ 00022 #define __UT_CharSetUtils__ 00023 00024 #include "UT_API.h" 00025 00026 class UT_String; 00027 00028 00029 class UT_API UT_CharSetUtils 00030 { 00031 public: 00032 // The encoding of the source code strings (ie, the char* stuff) 00033 // Currently it specifies ISO-9959-1 (Latin 1) char set. 00034 static const char * const SRC_CODE_ENCODING; 00035 00036 // The encoding used in the XML file. Currently it specifies UTF-8. 00037 static const char * const XML_ENCODING; 00038 00039 /// Conversion method from the source encoding to UTF-8 Unicode encoding. 00040 /// src_str - the input string bytestream in the src_encoding 00041 /// out_str - the output string bytesream in the UTF-8 encoding. 00042 /// src_encoding - always Latin 1 00043 // 00044 /// Returns true if ok, false otherwise. 00045 static bool encodeUTF8( const char * src_str, 00046 UT_String & out_str ); 00047 00048 /// Conversion method from the source encoding of UTF-8 to the encoding 00049 /// specified by the out_encoding. 00050 /// src_str - the input string bytestream in the UTF-8 encoding. 00051 /// out_str - the output string bytesream in the out_encoding. 00052 /// out_encoding - always Latin 1 00053 // 00054 /// Returns true if ok, false otherwise. 00055 static bool decodeUTF8( const char * src_str, 00056 UT_String & out_str ); 00057 00058 }; 00059 00060 #endif 00061
1.5.9