Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef UTF8_H
00022 #define UTF8_H
00023
00024 #include "dsodefs.h"
00025 #include "utility.h"
00026 #include <string>
00027
00028 #include <boost/cstdint.hpp>
00029 #include <limits>
00030
00032
00057 namespace utf8
00058 {
00059 static const boost::uint32_t invalid = std::numeric_limits<boost::uint32_t>::max();
00060
00062
00066
00069 DSOEXPORT std::wstring decodeCanonicalString(const std::string& str, int version);
00070
00072
00082 DSOEXPORT std::string encodeCanonicalString(const std::wstring& wstr, int version);
00083
00085
00090 DSOEXPORT boost::uint32_t decodeNextUnicodeCharacter(std::string::const_iterator& it,
00091 const std::string::const_iterator& e);
00092
00095 DSOEXPORT std::string encodeUnicodeCharacter(boost::uint32_t ucs_character);
00096
00098
00101 DSOEXPORT std::string encodeLatin1Character(boost::uint32_t ucsCharacter);
00102
00103 enum TextEncoding {
00104 encUNSPECIFIED,
00105 encUTF8,
00106 encUTF16BE,
00107 encUTF16LE,
00108 encUTF32BE,
00109 encUTF32LE,
00110 encSCSU,
00111 encUTF7,
00112 encUTFEBCDIC,
00113 encBOCU1
00114 };
00115
00117
00140 DSOEXPORT char* stripBOM(char* in, size_t& size, TextEncoding& encoding);
00141
00143 DSOEXPORT const char* textEncodingName(TextEncoding enc);
00144 }
00145
00146
00147 #endif // UTF8_H
00148
00149
00150
00151
00152
00153
00154
00155