#include <string.h>
#include <stdlib.h>
#include "ut_iconv.h"
#include "ut_assert.h"
#include "ut_debugmsg.h"
#include <glib.h>
#include "xap_EncodingManager.h"
Functions | |
static void | s_internal_init () |
const char * | ucs2Internal () |
const char * | ucs4Internal () |
int | UT_iconv_isValid (UT_iconv_t cd) |
UT_iconv_t | UT_iconv_open (const char *to, const char *from) |
size_t | UT_iconv (UT_iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) |
int | UT_iconv_close (UT_iconv_t cd) |
void | UT_iconv_reset (UT_iconv_t cd) |
char * | UT_convert (const char *str, UT_sint32 len, const char *from_codeset, const char *to_codeset, UT_uint32 *bytes_read_arg, UT_uint32 *bytes_written_arg) |
char * | UT_convert_cd (const char *str, UT_sint32 len, UT_iconv_t cd, UT_uint32 *bytes_read_arg, UT_uint32 *bytes_written_arg) |
Variables | |
static const char * | s_ucs2_internal = 0 |
static const char * | s_ucs4_internal = 0 |
static const char * | s_ucs2_list [] |
static const char * | s_ucs4_list [] |
static void s_internal_init | ( | ) | [static] |
References UT_ASSERT, UT_DEBUGMSG, UT_iconv(), UT_iconv_close(), UT_iconv_isValid(), and UT_iconv_open().
Referenced by ucs2Internal(), and ucs4Internal().
const char* ucs2Internal | ( | ) |
References s_internal_init().
const char* ucs4Internal | ( | ) |
References s_internal_init().
Referenced by init_values(), and UT_Wctomb::setOutCharset().
char* UT_convert | ( | const char * | str, | |
UT_sint32 | len, | |||
const char * | from_codeset, | |||
const char * | to_codeset, | |||
UT_uint32 * | bytes_read_arg, | |||
UT_uint32 * | bytes_written_arg | |||
) |
Borrowed from GLib 2.0 and (heavily) modified
str | Pointer to the input string. | |
len | Length of the input string to convert. | |
from_codeset | The "codeset" of the string pointed to by 'str'. | |
to_codeset | The "codeset" we want for the output. | |
bytes_read | optional, supply NULL if you don't want this. | |
bytes_written | optional, supply NULL if you don't want this. |
Referenced by IE_Imp_Hancom::_loadFile(), UT_Win32LocaleString::fromUCS4(), UT_Win32LocaleString::fromUTF8(), AP_UnixApp::pasteFromClipboard(), prepare_style_name(), UT_Win32LocaleString::ucs4_str(), UT_std_stringFromEncoding(), UT_UTF8String::UT_UTF8String(), UT_Win32LocaleString::utf8_str(), and utf8_to_ucs2().
char* UT_convert_cd | ( | const char * | str, | |
UT_sint32 | len, | |||
UT_iconv_t | cd, | |||
UT_uint32 * | bytes_read_arg, | |||
UT_uint32 * | bytes_written_arg | |||
) |
This function is almost the same as the other UT_convert function, only that it takes an UT_iconv_t instead of a from and to codeset. This is useful if you need to do a conversion multiple times
Referenced by IE_Imp_StarOffice::_loadFile(), XAP_StringSet::getValue(), DocHdr::load(), and readByteString().
size_t UT_iconv | ( | UT_iconv_t | cd, | |
const char ** | inbuf, | |||
size_t * | inbytesleft, | |||
char ** | outbuf, | |||
size_t * | outbytesleft | |||
) |
References UT_iconv_isValid().
Referenced by ev_Win32Keyboard::_emitChar(), IE_Exp_RTF::_rtf_chardata(), s_AskForPathname(), s_internal_init(), XAP_EncodingManager::strToNative(), try_CToU(), try_UToC(), UT_iconv_reset(), UT_Wctomb::wctomb(), and XAP_EncodingManager::XAP_XML_UnknownEncodingHandler().
int UT_iconv_close | ( | UT_iconv_t | cd | ) |
References UT_iconv_isValid().
Referenced by IE_Imp_StarOffice::_loadFile(), XAP_StringSet::getValue(), XAP_EncodingManager::initialize(), ev_Win32Keyboard::remapKeyboard(), s_internal_init(), UT_Wctomb::setOutCharset(), XAP_EncodingManager::strToNative(), UT_Encoding::UT_Encoding(), XAP_EncodingManager::XAP_XML_UnknownEncodingHandler(), UT_UCS4_mbtowc::Converter::~Converter(), UT_UCS2_mbtowc::Converter::~Converter(), DocHdr::~DocHdr(), ev_Win32Keyboard::~ev_Win32Keyboard(), IE_Exp_RTF::~IE_Exp_RTF(), UT_Wctomb::~UT_Wctomb(), and XAP_EncodingManager::~XAP_EncodingManager().
int UT_iconv_isValid | ( | UT_iconv_t | cd | ) |
Returns true if the internal handle is valid, false if not
References UT_ICONV_INVALID.
Referenced by IE_Imp_StarOffice::_loadFile(), IE_Exp_RTF::_rtf_chardata(), XAP_EncodingManager::describe(), findConverter(), XAP_StringSet::getValue(), init_values(), DocHdr::load(), SDWDocInfo::load(), UT_UCS4_mbtowc::mbtowc(), UT_UCS2_mbtowc::mbtowc(), s_AskForPathname(), s_internal_init(), XAP_EncodingManager::strToNative(), try_CToU(), try_UToC(), UT_Encoding::UT_Encoding(), UT_iconv(), UT_iconv_close(), UT_Wctomb::UT_Wctomb(), XAP_EncodingManager::XAP_XML_UnknownEncodingHandler(), UT_UCS4_mbtowc::Converter::~Converter(), UT_UCS2_mbtowc::Converter::~Converter(), DocHdr::~DocHdr(), IE_Exp_RTF::~IE_Exp_RTF(), and UT_Wctomb::~UT_Wctomb().
UT_iconv_t UT_iconv_open | ( | const char * | to, | |
const char * | from | |||
) |
Referenced by findConverter(), XAP_StringSet::getValue(), IE_Exp_RTF::IE_Exp_RTF(), init_values(), XAP_EncodingManager::initialize(), ev_Win32Keyboard::remapKeyboard(), s_AskForPathname(), s_internal_init(), UT_Wctomb::setOutCharset(), XAP_EncodingManager::strToNative(), UT_Encoding::UT_Encoding(), UT_Wctomb::UT_Wctomb(), and XAP_EncodingManager::XAP_XML_UnknownEncodingHandler().
void UT_iconv_reset | ( | UT_iconv_t | cd | ) |
References XAP_EncodingManager::get_instance(), and UT_iconv().
Referenced by UT_Wctomb::initialize(), UT_UCS4_mbtowc::Converter::initialize(), UT_UCS2_mbtowc::Converter::initialize(), try_CToU(), and try_UToC().
const char* s_ucs2_internal = 0 [static] |
const char* s_ucs2_list[] [static] |
{ "UCS-2-INTERNAL", "UCS-2-LE", "UCS-2-BE", "UCS-2LE", "UCS-2BE", "UTF16-LE", "UTF16-BE", "UCS2", "UCS-2", "UTF-16", 0 }
const char* s_ucs4_internal = 0 [static] |
const char* s_ucs4_list[] [static] |
{ "UCS-4-INTERNAL", "UCS-4-LE", "UCS-4-BE", "UCS-4LE", "UCS-4BE", "UTF-32LE", "UTF-32BE", "UCS4", "UCS-4", "UTF32", "UTF-32", 0 }