php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
mbstring.c File Reference

Go to the source code of this file.

Data Structures

struct  _php_mb_nls_ident_list
 
struct  candidate
 

Macros

#define MB_STRSTR   1
 
#define MB_STRRCHR   2
 
#define MB_STRISTR   3
 
#define MB_STRRICHR   4
 
#define DEC_ENTITY_MINLEN   3 /* For "&#" and 1 decimal digit */
 
#define HEX_ENTITY_MINLEN   4 /* For "&#x" and 1 hexadecimal digit */
 
#define DEC_ENTITY_MAXLEN   12 /* For "&#" and 10 decimal digits */
 
#define HEX_ENTITY_MAXLEN   11 /* For "&#x" and 8 hexadecimal digits */
 
#define CRLF   "\r\n"
 
#define PHP_MBSTR_MAIL_MIME_HEADER1   "MIME-Version: 1.0"
 
#define PHP_MBSTR_MAIL_MIME_HEADER2   "Content-Type: text/plain"
 
#define PHP_MBSTR_MAIL_MIME_HEADER3   "; charset="
 
#define PHP_MBSTR_MAIL_MIME_HEADER4   "Content-Transfer-Encoding: "
 
#define mb_fast_check_utf8   mb_fast_check_utf8_default
 
#define MBSTRING_HEADER_ENC_WCHAR_BUFSIZE   90
 

Typedefs

typedef struct _php_mb_nls_ident_list php_mb_nls_ident_list
 

Enumerations

enum  mb_trim_mode { MB_LTRIM = 1 , MB_RTRIM = 2 , MB_BOTH_TRIM = 3 }
 

Functions

uint32_t mb_convert_kana_codepoint (uint32_t c, uint32_t next, bool *consumed, uint32_t *second, int mode)
 
 STD_PHP_INI_BOOLEAN ("mbstring.encoding_translation", "0", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdate_mbstring_encoding_translation, encoding_translation, zend_mbstring_globals, mbstring_globals) PHP_INI_ENTRY("mbstring.http_output_conv_mimetypes"
 
text application xhtml OnUpdate_mbstring_http_output_conv_mimetypes STD_PHP_INI_BOOLEAN ("mbstring.strict_detection", "0", PHP_INI_ALL, OnUpdateBool, strict_detection, zend_mbstring_globals, mbstring_globals)
 
 PHP_MINIT_FUNCTION (mbstring)
 
 PHP_MSHUTDOWN_FUNCTION (mbstring)
 
 PHP_RINIT_FUNCTION (mbstring)
 
 PHP_RSHUTDOWN_FUNCTION (mbstring)
 
 PHP_MINFO_FUNCTION (mbstring)
 
 PHP_FUNCTION (mb_language)
 
 PHP_FUNCTION (mb_internal_encoding)
 
 PHP_FUNCTION (mb_http_input)
 
 PHP_FUNCTION (mb_http_output)
 
 PHP_FUNCTION (mb_detect_order)
 
 PHP_FUNCTION (mb_substitute_character)
 
 PHP_FUNCTION (mb_preferred_mime_name)
 
 PHP_FUNCTION (mb_parse_str)
 
 PHP_FUNCTION (mb_output_handler)
 
 PHP_FUNCTION (mb_str_split)
 
 PHP_FUNCTION (mb_strlen)
 
 PHP_FUNCTION (mb_strpos)
 
 PHP_FUNCTION (mb_strrpos)
 
 PHP_FUNCTION (mb_stripos)
 
 PHP_FUNCTION (mb_strripos)
 
 PHP_FUNCTION (mb_strstr)
 
 PHP_FUNCTION (mb_strrchr)
 
 PHP_FUNCTION (mb_stristr)
 
 PHP_FUNCTION (mb_strrichr)
 
 PHP_FUNCTION (mb_substr_count)
 
 PHP_FUNCTION (mb_substr)
 
 PHP_FUNCTION (mb_strcut)
 
 PHP_FUNCTION (mb_strwidth)
 
 PHP_FUNCTION (mb_strimwidth)
 
MBSTRING_API zend_stringphp_mb_convert_encoding_ex (const char *input, size_t length, const mbfl_encoding *to_encoding, const mbfl_encoding *from_encoding)
 
MBSTRING_API zend_stringphp_mb_convert_encoding (const char *input, size_t length, const mbfl_encoding *to_encoding, const mbfl_encoding **from_encodings, size_t num_from_encodings)
 
MBSTRING_API HashTablephp_mb_convert_encoding_recursive (HashTable *input, const mbfl_encoding *to_encoding, const mbfl_encoding **from_encodings, size_t num_from_encodings)
 
 PHP_FUNCTION (mb_convert_encoding)
 
 PHP_FUNCTION (mb_convert_case)
 
 PHP_FUNCTION (mb_strtoupper)
 
 PHP_FUNCTION (mb_strtolower)
 
 PHP_FUNCTION (mb_ucfirst)
 
 PHP_FUNCTION (mb_lcfirst)
 
 PHP_FUNCTION (mb_trim)
 
 PHP_FUNCTION (mb_ltrim)
 
 PHP_FUNCTION (mb_rtrim)
 
MBSTRING_API const mbfl_encodingmb_guess_encoding_for_strings (const unsigned char **strings, size_t *str_lengths, size_t n, const mbfl_encoding **elist, unsigned int elist_size, bool strict, bool order_significant)
 
 PHP_FUNCTION (mb_detect_encoding)
 
 PHP_FUNCTION (mb_list_encodings)
 
 PHP_FUNCTION (mb_encoding_aliases)
 
 PHP_FUNCTION (mb_convert_kana)
 
 PHP_FUNCTION (mb_convert_variables)
 
 PHP_FUNCTION (mb_encode_numericentity)
 
 PHP_FUNCTION (mb_decode_numericentity)
 
 PHP_FUNCTION (mb_send_mail)
 
 PHP_FUNCTION (mb_get_info)
 
MBSTRING_API bool php_mb_check_encoding (const char *input, size_t length, const mbfl_encoding *encoding)
 
 PHP_FUNCTION (mb_check_encoding)
 
 PHP_FUNCTION (mb_ord)
 
 PHP_FUNCTION (mb_chr)
 
 PHP_FUNCTION (mb_str_pad)
 
 PHP_FUNCTION (mb_scrub)
 
MBSTRING_API size_t php_mb_mbchar_bytes (const char *s, const mbfl_encoding *enc)
 
MBSTRING_API char * php_mb_safe_strrchr (const char *s, unsigned int c, size_t nbytes, const mbfl_encoding *enc)
 
MBSTRING_API size_t php_mb_stripos (bool mode, zend_string *haystack, zend_string *needle, zend_long offset, const mbfl_encoding *enc)
 
 PHP_FUNCTION (mb_encode_mimeheader)
 
 PHP_FUNCTION (mb_decode_mimeheader)
 

Variables

zend_module_entry mbstring_module_entry
 
text application xhtml xml
 
text application xhtml PHP_INI_ALL
 
char mb_convert_kana_flags [17]
 

Macro Definition Documentation

◆ CRLF

#define CRLF   "\r\n"

Definition at line 4296 of file mbstring.c.

◆ DEC_ENTITY_MAXLEN

#define DEC_ENTITY_MAXLEN   12 /* For "&#" and 10 decimal digits */

Definition at line 4085 of file mbstring.c.

◆ DEC_ENTITY_MINLEN

#define DEC_ENTITY_MINLEN   3 /* For "&#" and 1 decimal digit */

Definition at line 4083 of file mbstring.c.

◆ HEX_ENTITY_MAXLEN

#define HEX_ENTITY_MAXLEN   11 /* For "&#x" and 8 hexadecimal digits */

Definition at line 4086 of file mbstring.c.

◆ HEX_ENTITY_MINLEN

#define HEX_ENTITY_MINLEN   4 /* For "&#x" and 1 hexadecimal digit */

Definition at line 4084 of file mbstring.c.

◆ mb_fast_check_utf8

#define mb_fast_check_utf8   mb_fast_check_utf8_default

Definition at line 5261 of file mbstring.c.

◆ MB_STRISTR

#define MB_STRISTR   3

Definition at line 2153 of file mbstring.c.

◆ MB_STRRCHR

#define MB_STRRCHR   2

Definition at line 2152 of file mbstring.c.

◆ MB_STRRICHR

#define MB_STRRICHR   4

Definition at line 2154 of file mbstring.c.

◆ MB_STRSTR

#define MB_STRSTR   1

Definition at line 2151 of file mbstring.c.

◆ MBSTRING_HEADER_ENC_WCHAR_BUFSIZE

#define MBSTRING_HEADER_ENC_WCHAR_BUFSIZE   90

Definition at line 6151 of file mbstring.c.

◆ PHP_MBSTR_MAIL_MIME_HEADER1

#define PHP_MBSTR_MAIL_MIME_HEADER1   "MIME-Version: 1.0"

◆ PHP_MBSTR_MAIL_MIME_HEADER2

#define PHP_MBSTR_MAIL_MIME_HEADER2   "Content-Type: text/plain"

◆ PHP_MBSTR_MAIL_MIME_HEADER3

#define PHP_MBSTR_MAIL_MIME_HEADER3   "; charset="

◆ PHP_MBSTR_MAIL_MIME_HEADER4

#define PHP_MBSTR_MAIL_MIME_HEADER4   "Content-Transfer-Encoding: "

Typedef Documentation

◆ php_mb_nls_ident_list

Enumeration Type Documentation

◆ mb_trim_mode

Enumerator
MB_LTRIM 
MB_RTRIM 
MB_BOTH_TRIM 

Definition at line 3016 of file mbstring.c.

Function Documentation

◆ mb_convert_kana_codepoint()

uint32_t mb_convert_kana_codepoint ( uint32_t c,
uint32_t next,
bool * consumed,
uint32_t * second,
int mode )

◆ mb_guess_encoding_for_strings()

MBSTRING_API const mbfl_encoding * mb_guess_encoding_for_strings ( const unsigned char ** strings,
size_t * str_lengths,
size_t n,
const mbfl_encoding ** elist,
unsigned int elist_size,
bool strict,
bool order_significant )

Definition at line 3360 of file mbstring.c.

◆ PHP_FUNCTION() [1/49]

PHP_FUNCTION ( mb_check_encoding )

Definition at line 5626 of file mbstring.c.

◆ PHP_FUNCTION() [2/49]

PHP_FUNCTION ( mb_chr )

Definition at line 5792 of file mbstring.c.

◆ PHP_FUNCTION() [3/49]

PHP_FUNCTION ( mb_convert_case )

Definition at line 2911 of file mbstring.c.

◆ PHP_FUNCTION() [4/49]

PHP_FUNCTION ( mb_convert_encoding )

Definition at line 2838 of file mbstring.c.

◆ PHP_FUNCTION() [5/49]

PHP_FUNCTION ( mb_convert_kana )

Definition at line 3601 of file mbstring.c.

◆ PHP_FUNCTION() [6/49]

PHP_FUNCTION ( mb_convert_variables )

Definition at line 3819 of file mbstring.c.

◆ PHP_FUNCTION() [7/49]

PHP_FUNCTION ( mb_decode_mimeheader )

Definition at line 6718 of file mbstring.c.

◆ PHP_FUNCTION() [8/49]

PHP_FUNCTION ( mb_decode_numericentity )

Definition at line 4267 of file mbstring.c.

◆ PHP_FUNCTION() [9/49]

PHP_FUNCTION ( mb_detect_encoding )

Definition at line 3411 of file mbstring.c.

◆ PHP_FUNCTION() [10/49]

PHP_FUNCTION ( mb_detect_order )

Definition at line 1371 of file mbstring.c.

◆ PHP_FUNCTION() [11/49]

PHP_FUNCTION ( mb_encode_mimeheader )

Definition at line 6449 of file mbstring.c.

◆ PHP_FUNCTION() [12/49]

PHP_FUNCTION ( mb_encode_numericentity )

Definition at line 4035 of file mbstring.c.

◆ PHP_FUNCTION() [13/49]

PHP_FUNCTION ( mb_encoding_aliases )

Definition at line 3506 of file mbstring.c.

◆ PHP_FUNCTION() [14/49]

PHP_FUNCTION ( mb_get_info )

Definition at line 4720 of file mbstring.c.

◆ PHP_FUNCTION() [15/49]

PHP_FUNCTION ( mb_http_input )

Definition at line 1265 of file mbstring.c.

◆ PHP_FUNCTION() [16/49]

PHP_FUNCTION ( mb_http_output )

Definition at line 1342 of file mbstring.c.

◆ PHP_FUNCTION() [17/49]

PHP_FUNCTION ( mb_internal_encoding )

Definition at line 1235 of file mbstring.c.

◆ PHP_FUNCTION() [18/49]

PHP_FUNCTION ( mb_language )

Definition at line 1209 of file mbstring.c.

◆ PHP_FUNCTION() [19/49]

PHP_FUNCTION ( mb_lcfirst )

Definition at line 3011 of file mbstring.c.

◆ PHP_FUNCTION() [20/49]

PHP_FUNCTION ( mb_list_encodings )

Definition at line 3482 of file mbstring.c.

◆ PHP_FUNCTION() [21/49]

PHP_FUNCTION ( mb_ltrim )

Definition at line 3171 of file mbstring.c.

◆ PHP_FUNCTION() [22/49]

PHP_FUNCTION ( mb_ord )

Definition at line 5690 of file mbstring.c.

◆ PHP_FUNCTION() [23/49]

PHP_FUNCTION ( mb_output_handler )

Definition at line 1555 of file mbstring.c.

◆ PHP_FUNCTION() [24/49]

PHP_FUNCTION ( mb_parse_str )

Definition at line 1518 of file mbstring.c.

◆ PHP_FUNCTION() [25/49]

PHP_FUNCTION ( mb_preferred_mime_name )

Definition at line 1492 of file mbstring.c.

◆ PHP_FUNCTION() [26/49]

PHP_FUNCTION ( mb_rtrim )

Definition at line 3176 of file mbstring.c.

◆ PHP_FUNCTION() [27/49]

PHP_FUNCTION ( mb_scrub )

Definition at line 5939 of file mbstring.c.

◆ PHP_FUNCTION() [28/49]

PHP_FUNCTION ( mb_send_mail )

Definition at line 4459 of file mbstring.c.

◆ PHP_FUNCTION() [29/49]

PHP_FUNCTION ( mb_str_pad )

Definition at line 5812 of file mbstring.c.

◆ PHP_FUNCTION() [30/49]

PHP_FUNCTION ( mb_str_split )

Definition at line 1635 of file mbstring.c.

◆ PHP_FUNCTION() [31/49]

PHP_FUNCTION ( mb_strcut )

Definition at line 2378 of file mbstring.c.

◆ PHP_FUNCTION() [32/49]

PHP_FUNCTION ( mb_strimwidth )

Definition at line 2650 of file mbstring.c.

◆ PHP_FUNCTION() [33/49]

PHP_FUNCTION ( mb_stripos )

Definition at line 2032 of file mbstring.c.

◆ PHP_FUNCTION() [34/49]

PHP_FUNCTION ( mb_stristr )

Definition at line 2213 of file mbstring.c.

◆ PHP_FUNCTION() [35/49]

PHP_FUNCTION ( mb_strlen )

Definition at line 1846 of file mbstring.c.

◆ PHP_FUNCTION() [36/49]

PHP_FUNCTION ( mb_strpos )

Definition at line 1973 of file mbstring.c.

◆ PHP_FUNCTION() [37/49]

PHP_FUNCTION ( mb_strrchr )

Definition at line 2206 of file mbstring.c.

◆ PHP_FUNCTION() [38/49]

PHP_FUNCTION ( mb_strrichr )

Definition at line 2220 of file mbstring.c.

◆ PHP_FUNCTION() [39/49]

PHP_FUNCTION ( mb_strripos )

Definition at line 2063 of file mbstring.c.

◆ PHP_FUNCTION() [40/49]

PHP_FUNCTION ( mb_strrpos )

Definition at line 2002 of file mbstring.c.

◆ PHP_FUNCTION() [41/49]

PHP_FUNCTION ( mb_strstr )

Definition at line 2199 of file mbstring.c.

◆ PHP_FUNCTION() [42/49]

PHP_FUNCTION ( mb_strtolower )

Definition at line 2954 of file mbstring.c.

◆ PHP_FUNCTION() [43/49]

PHP_FUNCTION ( mb_strtoupper )

Definition at line 2936 of file mbstring.c.

◆ PHP_FUNCTION() [44/49]

PHP_FUNCTION ( mb_strwidth )

Definition at line 2520 of file mbstring.c.

◆ PHP_FUNCTION() [45/49]

PHP_FUNCTION ( mb_substitute_character )

Definition at line 1438 of file mbstring.c.

◆ PHP_FUNCTION() [46/49]

PHP_FUNCTION ( mb_substr )

Definition at line 2316 of file mbstring.c.

◆ PHP_FUNCTION() [47/49]

PHP_FUNCTION ( mb_substr_count )

Definition at line 2231 of file mbstring.c.

◆ PHP_FUNCTION() [48/49]

PHP_FUNCTION ( mb_trim )

Definition at line 3166 of file mbstring.c.

◆ PHP_FUNCTION() [49/49]

PHP_FUNCTION ( mb_ucfirst )

Definition at line 3006 of file mbstring.c.

◆ php_mb_check_encoding()

MBSTRING_API bool php_mb_check_encoding ( const char * input,
size_t length,
const mbfl_encoding * encoding )

Definition at line 4872 of file mbstring.c.

◆ php_mb_convert_encoding()

MBSTRING_API zend_string * php_mb_convert_encoding ( const char * input,
size_t length,
const mbfl_encoding * to_encoding,
const mbfl_encoding ** from_encodings,
size_t num_from_encodings )

Definition at line 2718 of file mbstring.c.

◆ php_mb_convert_encoding_ex()

MBSTRING_API zend_string * php_mb_convert_encoding_ex ( const char * input,
size_t length,
const mbfl_encoding * to_encoding,
const mbfl_encoding * from_encoding )

Definition at line 2710 of file mbstring.c.

◆ php_mb_convert_encoding_recursive()

MBSTRING_API HashTable * php_mb_convert_encoding_recursive ( HashTable * input,
const mbfl_encoding * to_encoding,
const mbfl_encoding ** from_encodings,
size_t num_from_encodings )

Definition at line 2738 of file mbstring.c.

◆ php_mb_mbchar_bytes()

MBSTRING_API size_t php_mb_mbchar_bytes ( const char * s,
const mbfl_encoding * enc )

Definition at line 5994 of file mbstring.c.

◆ php_mb_safe_strrchr()

MBSTRING_API char * php_mb_safe_strrchr ( const char * s,
unsigned int c,
size_t nbytes,
const mbfl_encoding * enc )

Definition at line 6010 of file mbstring.c.

◆ php_mb_stripos()

MBSTRING_API size_t php_mb_stripos ( bool mode,
zend_string * haystack,
zend_string * needle,
zend_long offset,
const mbfl_encoding * enc )

Definition at line 6049 of file mbstring.c.

◆ PHP_MINFO_FUNCTION()

PHP_MINFO_FUNCTION ( mbstring )

Definition at line 1183 of file mbstring.c.

◆ PHP_MINIT_FUNCTION()

PHP_MINIT_FUNCTION ( mbstring )

Definition at line 1054 of file mbstring.c.

◆ PHP_MSHUTDOWN_FUNCTION()

PHP_MSHUTDOWN_FUNCTION ( mbstring )

Definition at line 1103 of file mbstring.c.

◆ PHP_RINIT_FUNCTION()

PHP_RINIT_FUNCTION ( mbstring )

Definition at line 1120 of file mbstring.c.

◆ PHP_RSHUTDOWN_FUNCTION()

PHP_RSHUTDOWN_FUNCTION ( mbstring )

Definition at line 1141 of file mbstring.c.

◆ STD_PHP_INI_BOOLEAN() [1/2]

STD_PHP_INI_BOOLEAN ( "mbstring.encoding_translation" ,
"0" ,
PHP_INI_SYSTEM| PHP_INI_PERDIR,
OnUpdate_mbstring_encoding_translation ,
encoding_translation ,
zend_mbstring_globals ,
mbstring_globals  )

◆ STD_PHP_INI_BOOLEAN() [2/2]

text application xhtml OnUpdate_mbstring_http_output_conv_mimetypes STD_PHP_INI_BOOLEAN ( "mbstring.strict_detection" ,
"0" ,
PHP_INI_ALL ,
OnUpdateBool ,
strict_detection ,
zend_mbstring_globals ,
mbstring_globals  )

Definition at line 955 of file mbstring.c.

Variable Documentation

◆ mb_convert_kana_flags

char mb_convert_kana_flags[17]
Initial value:
= {
'A', 'R', 'N', 'S', 'K', 'H', 'M', 'C',
'a', 'r', 'n', 's', 'k', 'h', 'm', 'c',
'V'
}

Definition at line 3594 of file mbstring.c.

◆ mbstring_module_entry

zend_module_entry mbstring_module_entry
Initial value:
= {
mbstring_deps,
"mbstring",
ext_functions,
PHP_MINIT(mbstring),
PHP_MSHUTDOWN(mbstring),
PHP_RINIT(mbstring),
PHP_RSHUTDOWN(mbstring),
PHP_MINFO(mbstring),
PHP_MODULE_GLOBALS(mbstring),
PHP_GINIT(mbstring),
PHP_GSHUTDOWN(mbstring),
}
#define NULL
Definition gdcache.h:45
#define PHP_MBSTRING_VERSION
Definition mbstring.h:23
#define PHP_GINIT
Definition php.h:397
#define PHP_MINFO
Definition php.h:396
#define PHP_RINIT
Definition php.h:394
#define PHP_MSHUTDOWN
Definition php.h:393
#define PHP_RSHUTDOWN
Definition php.h:395
#define PHP_MINIT
Definition php.h:392
#define PHP_MODULE_GLOBALS
Definition php.h:408
#define PHP_GSHUTDOWN
Definition php.h:398
#define STANDARD_MODULE_PROPERTIES_EX
#define STANDARD_MODULE_HEADER_EX

Definition at line 198 of file mbstring.c.

◆ PHP_INI_ALL

text application xhtml PHP_INI_ALL

Definition at line 952 of file mbstring.c.

◆ xml

text application xhtml xml

Definition at line 951 of file mbstring.c.