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
00022 #ifndef UT_ICONV_H
00023 #define UT_ICONV_H
00024
00025
00026
00027
00028
00029 #ifndef UT_TYPES_H
00030 #include "ut_types.h"
00031 #endif
00032
00033 typedef void * UT_iconv_t;
00034
00035 #define UT_ICONV_INVALID ((UT_iconv_t)(-1))
00036
00037 #ifdef __cplusplus
00038
00039
00040 class ABI_EXPORT auto_iconv
00041 {
00042 public:
00043
00044 explicit auto_iconv(UT_iconv_t iconv);
00045
00046 explicit auto_iconv(const char * in_charset, const char *out_charset) noexcept(false);
00047 ~auto_iconv();
00048 operator UT_iconv_t();
00049
00050 UT_iconv_t getHandle ();
00051
00052 private:
00053
00054 auto_iconv(const auto_iconv&);
00055 void operator=(const auto_iconv&);
00056 UT_iconv_t m_h;
00057 };
00058
00059 #endif
00060
00061 G_BEGIN_DECLS
00062
00063 ABI_EXPORT const char * ucs2Internal ();
00064 #define UCS_2_INTERNAL ucs2Internal()
00065 ABI_EXPORT const char * ucs4Internal ();
00066 #define UCS_INTERNAL ucs4Internal()
00067
00068 ABI_EXPORT UT_iconv_t UT_iconv_open( const char* to, const char* from );
00069 ABI_EXPORT size_t UT_iconv( UT_iconv_t cd, const char **inbuf,
00070 size_t *inbytesleft, char **outbuf,
00071 size_t *outbytesleft );
00072 ABI_EXPORT int UT_iconv_close( UT_iconv_t cd );
00073 ABI_EXPORT void UT_iconv_reset( UT_iconv_t cd );
00074 ABI_EXPORT int UT_iconv_isValid ( UT_iconv_t cd );
00075
00076 ABI_EXPORT char * UT_convert (const char *str,
00077 UT_sint32 len,
00078 const char *from_codeset,
00079 const char *to_codeset,
00080 UT_uint32 *bytes_read,
00081 UT_uint32 *bytes_written);
00082
00083 ABI_EXPORT char * UT_convert_cd (const char *str,
00084 UT_sint32 len,
00085 UT_iconv_t cd,
00086 UT_uint32 *bytes_read,
00087 UT_uint32 *bytes_written);
00088
00089 G_END_DECLS
00090
00091 #endif
00092
00093
00094
00095