Kannel: Open Source WAP and SMS gateway
svn-r5336
|
Go to the source code of this file.
Data Structures | |
struct | alias_t |
Macros | |
#define | NRP '?' |
Typedefs | |
typedef struct alias_t | alias_t |
Functions | |
void | charset_init () |
void | charset_shutdown () |
void | charset_gsm_to_utf8 (Octstr *ostr) |
void | charset_utf8_to_gsm (Octstr *ostr) |
void | charset_gsm_to_latin1 (Octstr *ostr) |
void | charset_latin1_to_gsm (Octstr *ostr) |
void | charset_gsm_to_nrc_iso_21_german (Octstr *ostr) |
void | charset_nrc_iso_21_german_to_gsm (Octstr *ostr) |
int | charset_gsm_truncate (Octstr *gsm, long max) |
int | charset_to_utf8 (Octstr *from, Octstr **to, Octstr *charset_from) |
int | charset_from_utf8 (Octstr *utf8, Octstr **to, Octstr *charset_to) |
int | charset_convert (Octstr *string, char *charset_from, char *charset_to) |
Variables | |
struct { | |
int gsmesc | |
int latin1 | |
} | gsm_esctolatin1 [] |
struct { | |
int gsmesc | |
int unichar | |
} | gsm_esctouni [] |
static const unsigned char | gsm_to_latin1 [128] |
static const int | gsm_to_unicode [128] |
alias_t | chars_aliases [] |
#define NRP '?' |
Definition at line 73 of file charset.c.
Referenced by charset_utf8_to_gsm().
int charset_convert | ( | Octstr * | string, |
char * | charset_from, | ||
char * | charset_to | ||
) |
Definition at line 589 of file charset.c.
References debug(), error(), octstr_append_data(), octstr_get_cstr, octstr_len(), octstr_truncate(), and warning().
Referenced by charset_processing(), convert_addr_from_pdu(), convert_charset(), data_sm_to_msg(), handle_mo_dcs(), handle_mt_dcs(), httpsmsc_send(), init_batch(), msg_to_pdu(), normalize_charset(), obey_request_thread(), parse_attr_value(), parse_text(), pdu_to_msg(), sms_charset_processing(), soap_msgdata_attribute(), soap_msgdata_deps(), and soap_o2o_msgdata_attribute().
Definition at line 558 of file charset.c.
References handler, octstr_create_from_data, octstr_get_cstr, and octstr_len().
Referenced by octstr_recode().
void charset_gsm_to_latin1 | ( | Octstr * | ostr | ) |
Definition at line 394 of file charset.c.
References gsm_esctolatin1, gsm_to_latin1, gsmesc, octstr_delete(), octstr_get_char(), octstr_len(), and octstr_set_char().
Referenced by main().
void charset_gsm_to_nrc_iso_21_german | ( | Octstr * | ostr | ) |
Definition at line 460 of file charset.c.
References octstr_get_char(), octstr_len(), and octstr_set_char().
Referenced by msg_to_emimsg().
void charset_gsm_to_utf8 | ( | Octstr * | ostr | ) |
Convert octet string in GSM format to UTF-8. Every GSM character can be represented with unicode, hence nothing will be lost. Escaped charaters will be translated into appropriate UTF-8 character.
Definition at line 220 of file charset.c.
References gsm_esctouni, gsm_to_unicode, gsmesc, octstr_append(), octstr_append_char(), octstr_create, octstr_destroy(), octstr_get_char(), octstr_len(), octstr_truncate(), and warning().
Referenced by at2_decode7bituncompressed(), cimd2_accept_message(), convert_addr_from_pdu(), data_sm_to_msg(), extract_msgdata_part_by_coding(), handle_mo_dcs(), handle_operation(), main(), oisd_accept_message(), and pdu_to_msg().
int charset_gsm_truncate | ( | Octstr * | gsm, |
long | max | ||
) |
Definition at line 512 of file charset.c.
References gsm, octstr_get_char(), octstr_len(), and octstr_truncate().
Referenced by extract_msgdata_part_by_coding(), msg_to_emimsg(), and packet_encode_message().
void charset_init | ( | void | ) |
Definition at line 200 of file charset.c.
References alias_t::alias, chars_aliases, and alias_t::real.
Referenced by gwlib_init().
void charset_latin1_to_gsm | ( | Octstr * | ostr | ) |
Definition at line 430 of file charset.c.
References gw_assert(), latin1_to_gsm, octstr_get_char(), octstr_insert_data(), octstr_len(), and octstr_set_char().
void charset_nrc_iso_21_german_to_gsm | ( | Octstr * | ostr | ) |
Definition at line 486 of file charset.c.
References octstr_get_char(), octstr_len(), and octstr_set_char().
Referenced by handle_operation().
void charset_shutdown | ( | void | ) |
Definition at line 210 of file charset.c.
Referenced by gwlib_shutdown().
Definition at line 526 of file charset.c.
References from, handler, octstr_compare(), octstr_create_from_data, octstr_duplicate, octstr_get_cstr, octstr_imm(), and octstr_len().
Referenced by octstr_recode(), and set_charset().
void charset_utf8_to_gsm | ( | Octstr * | ostr | ) |
Convert octet string in UTF-8 format to GSM 03.38. Because not all UTF-8 charater can be converted to GSM 03.38 non convertable character replaces with NRP character (see define above). Special characters will be formed into escape sequences. Incomplete UTF-8 characters at the end of the string will be skipped.
Definition at line 288 of file charset.c.
References latin1_to_gsm, NRP, octstr_append(), octstr_append_char(), octstr_create, octstr_destroy(), octstr_get_char(), octstr_len(), octstr_truncate(), and warning().
Referenced by at2_pdu_encode(), extract_msgdata_part_by_coding(), handle_mt_dcs(), main(), msg_to_emimsg(), msg_to_pdu(), ois_append_sm_text(), packet_encode_message(), and sms_msgdata_len().
alias_t chars_aliases[] |
Definition at line 184 of file charset.c.
Referenced by charset_init().
const { ... } gsm_esctolatin1[] |
Referenced by charset_gsm_to_latin1().
const { ... } gsm_esctouni[] |
Struct maps escaped GSM chars to unicode codeposition.
Referenced by charset_gsm_to_utf8().
|
static |
Definition at line 128 of file charset.c.
Referenced by charset_gsm_to_latin1().
|
static |
Map GSM default alphabet characters to unicode codeposition. The escape character, at position 27, is mapped to a NRP, though normally the function that indexes into this table will treat it specially.
Definition at line 153 of file charset.c.
Referenced by charset_gsm_to_utf8().
int gsmesc |
Definition at line 84 of file charset.c.
Referenced by charset_gsm_to_latin1(), and charset_gsm_to_utf8().
int latin1 |
Definition at line 85 of file charset.c.
Referenced by convert_html_entity(), and ws_bc_encode().