|
YAZ 5.35.1
|
UTF-8 encoding / decoding. More...
Go to the source code of this file.
Functions | |
| static size_t | init_utf8 (yaz_iconv_t cd, yaz_iconv_decoder_t d, unsigned char *inp, size_t inbytesleft, size_t *no_read) |
| unsigned long | yaz_read_UTF8_char (const unsigned char *inp, size_t inbytesleft, size_t *no_read, int *error) |
| static unsigned long | read_utf8 (yaz_iconv_t cd, yaz_iconv_decoder_t d, unsigned char *inp, size_t inbytesleft, size_t *no_read) |
| static size_t | write_UTF8 (yaz_iconv_t cd, yaz_iconv_encoder_t en, unsigned long x, char **outbuf, size_t *outbytesleft) |
| size_t | yaz_write_UTF8_char (unsigned long x, char **outbuf, size_t *outbytesleft, int *error) |
| encodes UTF-8 sequence | |
| yaz_iconv_encoder_t | yaz_utf8_encoder (const char *tocode, yaz_iconv_encoder_t e) |
| yaz_iconv_decoder_t | yaz_utf8_decoder (const char *fromcode, yaz_iconv_decoder_t d) |
| int | yaz_utf8_check (const char *str) |
| check whether string apppers to be UTF-8 encoded | |
UTF-8 encoding / decoding.
Definition in file utf8.c.
|
static |
Definition at line 20 of file utf8.c.
References YAZ_ICONV_EINVAL, and yaz_iconv_set_errno().
Referenced by yaz_utf8_decoder().
|
static |
Definition at line 138 of file utf8.c.
References yaz_iconv_set_errno(), and yaz_read_UTF8_char().
Referenced by yaz_utf8_decoder().
|
static |
Definition at line 149 of file utf8.c.
References yaz_iconv_set_errno(), and yaz_write_UTF8_char().
Referenced by yaz_utf8_encoder().
| unsigned long yaz_read_UTF8_char | ( | const unsigned char * | inp, |
| size_t | inbytesleft, | ||
| size_t * | no_read, | ||
| int * | error | ||
| ) |
Definition at line 41 of file utf8.c.
References YAZ_ICONV_EILSEQ, and YAZ_ICONV_EINVAL.
Referenced by cdata_one_character(), read_utf8(), and yaz_utf8_check().
| int yaz_utf8_check | ( | const char * | cstr | ) |
check whether string apppers to be UTF-8 encoded
| cstr | string to check |
| 1 | OK (appears to be UTF-8) |
| 0 | definitely not UTF-8 |
Definition at line 243 of file utf8.c.
References yaz_read_UTF8_char().
| yaz_iconv_decoder_t yaz_utf8_decoder | ( | const char * | fromcode, |
| yaz_iconv_decoder_t | d | ||
| ) |
Definition at line 231 of file utf8.c.
References yaz_iconv_decoder_s::init_handle, init_utf8(), yaz_iconv_decoder_s::read_handle, read_utf8(), and yaz_matchstr().
Referenced by prepare_decoders().
| yaz_iconv_encoder_t yaz_utf8_encoder | ( | const char * | tocode, |
| yaz_iconv_encoder_t | e | ||
| ) |
Definition at line 219 of file utf8.c.
References yaz_iconv_encoder_s::write_handle, write_UTF8(), and yaz_matchstr().
Referenced by prepare_encoders().
| size_t yaz_write_UTF8_char | ( | unsigned long | x, |
| char ** | outbuf, | ||
| size_t * | outbytesleft, | ||
| int * | error | ||
| ) |
encodes UTF-8 sequence
| x | the UNICODE value |
| outbuf | output buffer pointer, updated if conversion is successful |
| outbytesleft | length of buffer, updated if conversino is successful |
| error | pointer to error code if error occurs |
| 0 | if successful |
| -1 | for error |
Definition at line 159 of file utf8.c.
References YAZ_ICONV_E2BIG.
Referenced by json_one_char(), lookup_marc8(), and write_UTF8().