ekg2
GIT master
|
Struktury danych | |
struct | ekg_encoding_pair |
Funkcje | |
void * | ekg_convert_string_init (const char *from, const char *to, void **rev) |
void | ekg_convert_string_destroy (void *ptr) |
char * | ekg_convert_string_p (const char *ps, void *ptr) |
char * | ekg_convert_string (const char *ps, const char *from, const char *to) |
string_t | ekg_convert_string_t_p (string_t s, void *ptr) |
string_t | ekg_convert_string_t (string_t s, const char *from, const char *to) |
void | ekg_recode_inc_ref (const gchar *enc) |
void | ekg_recode_dec_ref (const gchar *enc) |
char * | ekg_recode_from_core (const gchar *enc, gchar *buf) |
gchar * | ekg_recode_to_core (const gchar *enc, char *buf) |
char * | ekg_recode_from_core_dup (const gchar *enc, const gchar *buf) |
gchar * | ekg_recode_to_core_dup (const gchar *enc, const char *buf) |
const char * | ekg_recode_from_core_use (const gchar *enc, const gchar *buf) |
const gchar * | ekg_recode_to_core_use (const gchar *enc, const char *buf) |
gchar * | ekg_recode_from (const gchar *enc, const char *str) |
char * | ekg_recode_to (const gchar *enc, const gchar *str) |
gchar * | ekg_recode_from_locale (const char *str) |
char * | ekg_recode_to_locale (const gchar *str) |
static gboolean | gstring_recode_helper (GString *s, const gchar *from, const gchar *to, gboolean fixutf) |
gboolean | ekg_recode_gstring_from (const gchar *enc, GString *s) |
gboolean | ekg_try_recode_gstring_from (const gchar *enc, GString *s) |
gboolean | ekg_recode_gstring_to (const gchar *enc, GString *s) |
void | ekg_fix_utf8 (gchar *buf) |
static void | fstr_mark_linebreaks (gchar *s, fstr_attr_t *a) |
fstring_t * | ekg_recode_fstr_to_locale (const fstring_t *fstr) |
char* ekg_convert_string | ( | const char * | ps, |
const char * | from, | ||
const char * | to | ||
) |
Converts string to specified encoding, replacing invalid chars with question marks.
ps | - string to be converted (it won't be freed). |
from | - input encoding (if NULL, console_charset will be assumed). |
to | - output encoding (if NULL, console_charset will be assumed). |
void ekg_convert_string_destroy | ( | void * | ptr | ) |
Frees internal data associated with given pointer, and uninitalizes iconv, if it's not needed anymore.
ptr | - pointer returned by ekg_convert_string_init(). |
void* ekg_convert_string_init | ( | const char * | from, |
const char * | to, | ||
void ** | rev | ||
) |
Initialize string conversion thing for two given charsets.
from | - input encoding (will be duped; if NULL, console_charset will be assumed). |
to | - output encoding (will be duped; if NULL, console_charset will be assumed). |
rev | - pointer to assign reverse conversion into; if NULL, no reverse converter will be initialized. |
char* ekg_convert_string_p | ( | const char * | ps, |
void * | ptr | ||
) |
Converts string to specified encoding, using pointer returned by ekg_convert_string_init(). Invalid characters in input will be replaced with question marks.
ps | - string to be converted (won't be freed). |
ptr | - pointer returned by ekg_convert_string_init(). |
void ekg_fix_utf8 | ( | gchar * | buf | ) |
Ensure correct utf8 in buffer, replacing incorrect sequences.
buf | - writable, null-terminated, utf8 string. |
void ekg_recode_dec_ref | ( | const gchar * | enc | ) |
gchar* ekg_recode_from | ( | const gchar * | enc, |
const char * | str | ||
) |
Convert complete string str from given encoding to ekg2 internal encoding (utf8). If the conversion fails, fallback to duplicating and utf8-cleaning str.
enc | - source encoding (e.g. "iso-8859-2"). |
str | - string to recode [may be NULL]. |
char* ekg_recode_from_core | ( | const gchar * | enc, |
gchar * | buf | ||
) |
char* ekg_recode_from_core_dup | ( | const gchar * | enc, |
const gchar * | buf | ||
) |
const char* ekg_recode_from_core_use | ( | const gchar * | enc, |
const gchar * | buf | ||
) |
gchar* ekg_recode_from_locale | ( | const char * | str | ) |
Convert complete string str from locale to ekg2 internal encoding (utf8). If the conversion fails, fallback to duplicating and utf8-cleaning the string.
str | - string to recode. May be NULL. |
Recode fstring_t from ekg2 internal encoding (utf8) to locale, adjusting attributes as necessary. Set attributes based on special unicode character properties (e.g. FSTR_LINEBREAK).
fstr | - input fstring_t. |
gboolean ekg_recode_gstring_from | ( | const gchar * | enc, |
GString * | s | ||
) |
Convert complete GString in-place from given encoding to ekg2 internal encoding (utf8). If the conversion fails, fallback to utf8-cleaning the string.
enc | - source encoding. |
s | - GString to recode and to write the result into. After the call to this function, it is guaranteed to contain correct utf8. |
gboolean ekg_recode_gstring_to | ( | const gchar * | enc, |
GString * | s | ||
) |
Convert complete GString in-place from ekg2 internal encoding (utf8) to given encoding. If the conversion fails, leave string unchanged.
enc | - target encoding. |
s | - GString to recode and to write the result into if the conversion succeeds. |
void ekg_recode_inc_ref | ( | const gchar * | enc | ) |
char* ekg_recode_to | ( | const gchar * | enc, |
const gchar * | str | ||
) |
Convert complete string str from ekg2 internal encoding (utf8) to given encoding. If the conversion fails, fallback to duplicating the string.
enc | - target encoding (e.g. "iso-8859-2"). |
str | - string to recode [may be NULL]. |
gchar* ekg_recode_to_core | ( | const gchar * | enc, |
char * | buf | ||
) |
gchar* ekg_recode_to_core_dup | ( | const gchar * | enc, |
const char * | buf | ||
) |
const gchar* ekg_recode_to_core_use | ( | const gchar * | enc, |
const char * | buf | ||
) |
char* ekg_recode_to_locale | ( | const gchar * | str | ) |
Convert complete string str from ekg2 internal encoding (utf8) to locale. If the conversion fails, fallback to duplicating the string.
str | - string to recode. May be NULL. |
gboolean ekg_try_recode_gstring_from | ( | const gchar * | enc, |
GString * | s | ||
) |
Convert complete GString in-place from given encoding to ekg2 internal encoding (utf8). If the conversion fails, leave string unchanged.
enc | - source encoding. |
s | - GString to recode and to write the result into if the conversion succeeds. |
|
static |
|
static |