Defines | |
#define | CHUNK_ALLOC 4 |
Functions | |
static void | _iconv_close (iconv_t *cd) |
static const char * | collate2charset (int sql_collate, int lcid) |
static int | lookup_canonic (const CHARACTER_SET_ALIAS aliases[], const char *charset_name) |
static int | skip_one_input_sequence (iconv_t cd, const TDS_ENCODING *charset, const char **input, size_t *input_size) |
Move the input sequence pointer to the next valid position. | |
void | tds7_srv_charset_changed (TDSSOCKET *tds, int sql_collate, int lcid) |
static int | tds_canonical_charset (const char *charset_name) |
Determine canonical iconv character set. | |
const char * | tds_canonical_charset_name (const char *charset_name) |
Determine canonical iconv character set name. | |
size_t | tds_iconv (TDSSOCKET *tds, const TDSICONV *conv, TDS_ICONV_DIRECTION io, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) |
Wrapper around iconv(3). | |
void | tds_iconv_close (TDSSOCKET *tds) |
size_t | tds_iconv_fread (iconv_t cd, FILE *stream, size_t field_len, size_t term_len, char *outbuf, size_t *outbytesleft) |
Read a data file, passing the data through iconv(). | |
void | tds_iconv_free (TDSSOCKET *tds) |
TDSICONV * | tds_iconv_from_collate (TDSSOCKET *tds, int sql_collate, int lcid) |
Get iconv information from a LCID (to support different column encoding under MSSQL2K). | |
static TDSICONV * | tds_iconv_get_info (TDSSOCKET *tds, const char *canonic_charset) |
Get a iconv info structure, allocate and initialize if needed. | |
static void | tds_iconv_info_close (TDSICONV *char_conv) |
static int | tds_iconv_info_init (TDSICONV *char_conv, const char *client_name, const char *server_name) |
Open iconv descriptors to convert between character sets (both directions). | |
void | tds_iconv_open (TDSSOCKET *tds, const char *charset) |
void | tds_srv_charset_changed (TDSSOCKET *tds, const char *charset) |
const char * | tds_sybase_charset_name (const char *charset_name) |
Determine the name Sybase uses for a character set, given a canonical iconv name. | |
size_t | tds_sys_iconv (iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) |
int | tds_sys_iconv_close (iconv_t cd) |
iconv_t | tds_sys_iconv_open (const char *tocode, const char *fromcode) |
Inputs are FreeTDS canonical names, no other. |
Set up the initial iconv conversion descriptors. When the socket is allocated, three TDSICONV structures are attached to iconv. They have fixed meanings:
To solve different iconv names and portability problems FreeTDS maintains a list of aliases each charset.
First we discover the names of our minimum required charsets (UTF-8, ISO8859-1 and UCS2). Later, as and when it's needed, we try to discover others.
There is one list of canonic names (GNU iconv names) and two sets of aliases (one for other iconv implementations and another for Sybase). For every canonic charset name we cache the iconv name found during discovery.
|
Move the input sequence pointer to the next valid position. Used when an input character cannot be converted.
|
|
Determine canonical iconv character set.
|
|
Determine canonical iconv character set name.
|
|
Wrapper around iconv(3). Same parameters, with slightly different behavior.
|
|
Read a data file, passing the data through iconv().
|
|
Open iconv descriptors to convert between character sets (both directions). 1. Look up the canonical names of the character sets. 2. Look up their widths. 3. Ask iconv to open a conversion descriptor. 4. Fail if any of the above offer any resistance.
|
|
Determine the name Sybase uses for a character set, given a canonical iconv name.
|
|
Inputs are FreeTDS canonical names, no other. No alias list is consulted. |