Back to index

php5  5.3.10
Functions | Variables
mbfl_encoding.c File Reference
#include "mbfl_encoding.h"
#include "mbfilter_pass.h"
#include "mbfilter_8bit.h"
#include "mbfilter_wchar.h"
#include "filters/mbfilter_euc_cn.h"
#include "filters/mbfilter_hz.h"
#include "filters/mbfilter_euc_tw.h"
#include "filters/mbfilter_big5.h"
#include "filters/mbfilter_uhc.h"
#include "filters/mbfilter_euc_kr.h"
#include "filters/mbfilter_iso2022_kr.h"
#include "filters/mbfilter_sjis.h"
#include "filters/mbfilter_sjis_open.h"
#include "filters/mbfilter_cp51932.h"
#include "filters/mbfilter_jis.h"
#include "filters/mbfilter_iso2022_jp_ms.h"
#include "filters/mbfilter_euc_jp.h"
#include "filters/mbfilter_euc_jp_win.h"
#include "filters/mbfilter_ascii.h"
#include "filters/mbfilter_koi8r.h"
#include "filters/mbfilter_koi8u.h"
#include "filters/mbfilter_cp866.h"
#include "filters/mbfilter_cp932.h"
#include "filters/mbfilter_cp936.h"
#include "filters/mbfilter_cp1251.h"
#include "filters/mbfilter_cp1252.h"
#include "filters/mbfilter_cp1254.h"
#include "filters/mbfilter_cp5022x.h"
#include "filters/mbfilter_iso8859_1.h"
#include "filters/mbfilter_iso8859_2.h"
#include "filters/mbfilter_iso8859_3.h"
#include "filters/mbfilter_iso8859_4.h"
#include "filters/mbfilter_iso8859_5.h"
#include "filters/mbfilter_iso8859_6.h"
#include "filters/mbfilter_iso8859_7.h"
#include "filters/mbfilter_iso8859_8.h"
#include "filters/mbfilter_iso8859_9.h"
#include "filters/mbfilter_iso8859_10.h"
#include "filters/mbfilter_iso8859_13.h"
#include "filters/mbfilter_iso8859_14.h"
#include "filters/mbfilter_iso8859_15.h"
#include "filters/mbfilter_iso8859_16.h"
#include "filters/mbfilter_base64.h"
#include "filters/mbfilter_qprint.h"
#include "filters/mbfilter_uuencode.h"
#include "filters/mbfilter_7bit.h"
#include "filters/mbfilter_utf7.h"
#include "filters/mbfilter_utf7imap.h"
#include "filters/mbfilter_utf8.h"
#include "filters/mbfilter_utf16.h"
#include "filters/mbfilter_utf32.h"
#include "filters/mbfilter_byte2.h"
#include "filters/mbfilter_byte4.h"
#include "filters/mbfilter_ucs4.h"
#include "filters/mbfilter_ucs2.h"
#include "filters/mbfilter_htmlent.h"
#include "filters/mbfilter_armscii8.h"
#include "filters/mbfilter_cp850.h"

Go to the source code of this file.

Functions

const mbfl_encodingmbfl_name2encoding (const char *name)
const mbfl_encodingmbfl_no2encoding (enum mbfl_no_encoding no_encoding)
enum mbfl_no_encoding mbfl_name2no_encoding (const char *name)
const char * mbfl_no_encoding2name (enum mbfl_no_encoding no_encoding)
const mbfl_encoding ** mbfl_get_supported_encodings (void)
const char * mbfl_no2preferred_mime_name (enum mbfl_no_encoding no_encoding)
int mbfl_is_support_encoding (const char *name)

Variables

static const char * mbfl_encoding_auto_aliases [] = {"unknown", NULL}
static const mbfl_encoding mbfl_encoding_auto
static const mbfl_encodingmbfl_encoding_ptr_list []

Function Documentation

Definition at line 290 of file mbfl_encoding.c.

int mbfl_is_support_encoding ( const char *  name)

Definition at line 309 of file mbfl_encoding.c.

{
       const mbfl_encoding *encoding;

       encoding = mbfl_name2encoding(name);
       if (encoding == NULL) {
              return 0;
       } else {
              return 1;
       }
}

Here is the call graph for this function:

const mbfl_encoding* mbfl_name2encoding ( const char *  name)

Definition at line 204 of file mbfl_encoding.c.

{
       const mbfl_encoding *encoding;
       int i, j;

       if (name == NULL) {
              return NULL;
       }

       i = 0;
       while ((encoding = mbfl_encoding_ptr_list[i++]) != NULL){
              if (strcasecmp(encoding->name, name) == 0) {
                     return encoding;
              }
       }

       /* serch MIME charset name */
       i = 0;
       while ((encoding = mbfl_encoding_ptr_list[i++]) != NULL) {
              if (encoding->mime_name != NULL) {
                     if (strcasecmp(encoding->mime_name, name) == 0) {
                            return encoding;
                     }
              }
       }

       /* serch aliases */
       i = 0;
       while ((encoding = mbfl_encoding_ptr_list[i++]) != NULL) {
              if (encoding->aliases != NULL) {
                     j = 0;
                     while ((*encoding->aliases)[j] != NULL) {
                            if (strcasecmp((*encoding->aliases)[j], name) == 0) {
                                   return encoding;
                            }
                            j++;
                     }
              }
       }

       return NULL;
}

Here is the caller graph for this function:

enum mbfl_no_encoding mbfl_name2no_encoding ( const char *  name)

Definition at line 264 of file mbfl_encoding.c.

{
       const mbfl_encoding *encoding;

       encoding = mbfl_name2encoding(name);
       if (encoding == NULL) {
              return mbfl_no_encoding_invalid;
       } else {
              return encoding->no_encoding;
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

const mbfl_encoding* mbfl_no2encoding ( enum mbfl_no_encoding  no_encoding)

Definition at line 248 of file mbfl_encoding.c.

{
       const mbfl_encoding *encoding;
       int i;

       i = 0;
       while ((encoding = mbfl_encoding_ptr_list[i++]) != NULL){
              if (encoding->no_encoding == no_encoding) {
                     return encoding;
              }
       }

       return NULL;
}

Here is the caller graph for this function:

const char* mbfl_no2preferred_mime_name ( enum mbfl_no_encoding  no_encoding)

Definition at line 296 of file mbfl_encoding.c.

{
       const mbfl_encoding *encoding;

       encoding = mbfl_no2encoding(no_encoding);
       if (encoding != NULL && encoding->mime_name != NULL && encoding->mime_name[0] != '\0') {
              return encoding->mime_name;
       } else {
              return NULL;
       }
}

Here is the call graph for this function:

const char* mbfl_no_encoding2name ( enum mbfl_no_encoding  no_encoding)

Definition at line 277 of file mbfl_encoding.c.

{
       const mbfl_encoding *encoding;

       encoding = mbfl_no2encoding(no_encoding);
       if (encoding == NULL) {
              return "";
       } else {
              return encoding->name;
       }
}

Here is the call graph for this function:


Variable Documentation

Initial value:
 {
       mbfl_no_encoding_auto,
       "auto",
       NULL,
       (const char *(*)[])&mbfl_encoding_auto_aliases,
       NULL,
       0
}

Definition at line 116 of file mbfl_encoding.c.

const char* mbfl_encoding_auto_aliases[] = {"unknown", NULL} [static]

Definition at line 114 of file mbfl_encoding.c.

Definition at line 125 of file mbfl_encoding.c.