com.caucho.quercus.lib.i18n
Class MbstringModule

java.lang.Object
  extended by com.caucho.quercus.module.AbstractQuercusModule
      extended by com.caucho.quercus.lib.i18n.MbstringModule
All Implemented Interfaces:
QuercusModule

public class MbstringModule
extends AbstractQuercusModule


Field Summary
static int MB_CASE_LOWER
           
static int MB_CASE_TITLE
           
static int MB_CASE_UPPER
           
 
Fields inherited from class com.caucho.quercus.module.AbstractQuercusModule
PHP_INI_ALL, PHP_INI_PERDIR, PHP_INI_SYSTEM, PHP_INI_USER
 
Constructor Summary
MbstringModule()
           
 
Method Summary
static java.lang.String getEncoding(Env env)
           
 IniDefinitions getIniDefinitions()
          Returns the default php.ini values.
 java.lang.String[] getLoadedExtensions()
          Returns the extensions implemented by the module.
 boolean mb_check_encoding(Env env, Value var, java.lang.String encoding)
          Checks if the string is correctly encoded.
static StringValue mb_convert_case(Env env, StringValue str, int mode, java.lang.String encoding)
          Upper-cases, lower-cases, or capitalizes first letter of words.
static Value mb_convert_encoding(Env env, StringValue str, java.lang.String destEncoding, Value fromEncodings)
          Converts string of one encoding to another.
static StringValue mb_convert_kana(Env env, StringValue str, java.lang.String option, java.lang.String encoding)
          Performs Japanese specific charset conversion.
static StringValue mb_convert_variables(Env env, java.lang.String toEncoding, java.lang.String fromEncodings, Value vars)
          Decodes and then encodes variables.
static Value mb_decode_mimeheader(Env env, StringValue str)
          Decodes mime field.
static StringValue mb_decode_numericentity(Env env, StringValue str, ArrayValue convmap, java.lang.String encoding)
          Decodes HTML numeric entity.
static Value mb_detect_encoding(Env env, StringValue str, Value encodingV, boolean isStrict)
          Detects encoding of string.
static Value mb_detect_order(Env env, Value encodingV)
          Specifies order of charsets to test when detecting encoding.
static StringValue mb_encode_mimeheader(Env env, StringValue str, java.lang.String charset, java.lang.String transfer_encoding, java.lang.String linefeed)
          Encodes a string into mime.
static StringValue mb_encode_numericentity(Env env, StringValue str, ArrayValue convmap, java.lang.String encoding)
          Encodes HTML numeric string entity.
static BooleanValue mb_ereg_match(Env env, UnicodeEreg ereg, StringValue string, java.lang.String option)
          Returns true if pattern matches a part of string.
static Value mb_ereg_replace(Env env, Value eregValue, StringValue replacement, StringValue subject, java.lang.String option)
          Multibyte version of ereg_replace.
static LongValue mb_ereg_search_getpos(Env env)
          Gets current position of ereg state object.
static Value mb_ereg_search_getregs(Env env)
          Gets the last match of ereg state object from previous matching.
static BooleanValue mb_ereg_search_init(Env env, StringValue string, Value rawRegexp, Value option)
          Initializes a ereg state object.
static Value mb_ereg_search_pos(Env env, Value rawRegexp, Value option)
          Returns index and position after matching.
static Value mb_ereg_search_regs(Env env, Value rawRegexp, Value option)
          Returns match array after matching.
static BooleanValue mb_ereg_search_setpos(Env env, int position)
          Sets the position of the ereg state object.
static BooleanValue mb_ereg_search(Env env, Value rawRegexp, Value option)
          Returns whether or not pattern matches string.
static Value mb_ereg(Env env, UnicodeEreg ereg, StringValue string, ArrayValue regs)
          Multibyte version of ereg.
static Value mb_eregi_replace(Env env, Value pattern, StringValue replacement, StringValue subject, java.lang.String option)
          Multibyte version of eregi_replace.
static Value mb_eregi(Env env, UnicodeEregi eregi, StringValue string, ArrayValue regs)
          Multibyte version of eregi.
static Value mb_get_info(Env env, java.lang.String type)
          Returns current mb settings.
static Value mb_http_input(Env env, java.lang.String type)
          Returns and/or sets the http input encoding
static Value mb_http_output(Env env, java.lang.String encoding)
          Returns and/or sets the http output encoding
static Value mb_internal_encoding(Env env, java.lang.String encoding)
          Returns and/or sets the internal encoding.
static Value mb_language(Env env, java.lang.String language)
          Returns and/or sets the encoding for mail.
static ArrayValue mb_list_encodings(Env env)
          Get all supported encodings.
static StringValue mb_output_handler(Env env, StringValue contents, int status)
          ob_start() handler
static BooleanValue mb_parse_str(Env env, StringValue strValue, Value result)
          Multibyte version of parse_str.
static StringValue mb_preferred_mime_name(Env env, StringValue encoding)
          Returns the preferred mime name of this encoding.
static Value mb_regex_encoding(Env env, java.lang.String encoding)
          Returns and/or sets encoding for mb regular expressions.
static StringValue mb_regex_set_options(Env env, java.lang.String options)
          XXX: what does this actually do?
static BooleanValue mb_send_mail(Env env, StringValue to, StringValue subject, StringValue message, StringValue additionalHeaders, StringValue additionalParameters)
          Multibyte version of mail.
static Value mb_split(Env env, UnicodeEreg ereg, StringValue string, long limit)
          Multibyte version of split.
static StringValue mb_strcut(Env env, StringValue str, int start, int length, java.lang.String encoding)
          Similar to substr except start index is at the beginning of char boundaries.
static StringValue mb_strimwidth(Env env, StringValue str, int start, int width, StringValue trimmarker, java.lang.String encoding)
          Truncates the string.
static LongValue mb_strlen(Env env, StringValue str, java.lang.String encoding)
          Multibyte version of strlen.
static Value mb_strpos(Env env, StringValue haystack, StringValue needle, int offset, java.lang.String encoding)
          Multibyte version of strpos.
static Value mb_strrpos(Env env, StringValue haystack, StringValue needle, Value offsetV, java.lang.String encoding)
          Multibyte version of strrpos.
static StringValue mb_strtolower(Env env, StringValue str, java.lang.String encoding)
          Converts all characters to lower-case.
static StringValue mb_strtoupper(Env env, StringValue str, java.lang.String encoding)
          Converts all characters to upper-case.
static LongValue mb_strwidth(Env env, StringValue str, java.lang.String encoding)
          Returns the width of this multibyte string.
static Value mb_substitute_character(Value substrchar)
          Sets the character to use when decoding/encoding fails on a character.
static LongValue mb_substr_count(Env env, StringValue haystack, StringValue needle, java.lang.String encoding)
           
static StringValue mb_substr(Env env, StringValue str, int start, Value lengthV, java.lang.String encoding)
          Multibyte version of substr.
 
Methods inherited from class com.caucho.quercus.module.AbstractQuercusModule
addConstant, addConstant, addConstant, getConstMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MB_CASE_UPPER

public static final int MB_CASE_UPPER
See Also:
Constant Field Values

MB_CASE_LOWER

public static final int MB_CASE_LOWER
See Also:
Constant Field Values

MB_CASE_TITLE

public static final int MB_CASE_TITLE
See Also:
Constant Field Values
Constructor Detail

MbstringModule

public MbstringModule()
Method Detail

getLoadedExtensions

public java.lang.String[] getLoadedExtensions()
Returns the extensions implemented by the module.

Specified by:
getLoadedExtensions in interface QuercusModule
Overrides:
getLoadedExtensions in class AbstractQuercusModule

getIniDefinitions

public IniDefinitions getIniDefinitions()
Returns the default php.ini values.

Specified by:
getIniDefinitions in interface QuercusModule
Overrides:
getIniDefinitions in class AbstractQuercusModule

mb_check_encoding

public boolean mb_check_encoding(Env env,
                                 Value var,
                                 java.lang.String encoding)
Checks if the string is correctly encoded. XXX: no args


mb_convert_case

public static StringValue mb_convert_case(Env env,
                                          StringValue str,
                                          int mode,
                                          java.lang.String encoding)
Upper-cases, lower-cases, or capitalizes first letter of words.


mb_convert_encoding

public static Value mb_convert_encoding(Env env,
                                        StringValue str,
                                        java.lang.String destEncoding,
                                        Value fromEncodings)
Converts string of one encoding to another.


mb_convert_kana

public static StringValue mb_convert_kana(Env env,
                                          StringValue str,
                                          java.lang.String option,
                                          java.lang.String encoding)
Performs Japanese specific charset conversion.


mb_convert_variables

public static StringValue mb_convert_variables(Env env,
                                               java.lang.String toEncoding,
                                               java.lang.String fromEncodings,
                                               Value vars)
Decodes and then encodes variables. XXX: variable arguments to convert.


mb_decode_mimeheader

public static Value mb_decode_mimeheader(Env env,
                                         StringValue str)
Decodes mime field.


mb_decode_numericentity

public static StringValue mb_decode_numericentity(Env env,
                                                  StringValue str,
                                                  ArrayValue convmap,
                                                  java.lang.String encoding)
Decodes HTML numeric entity.


mb_detect_encoding

public static Value mb_detect_encoding(Env env,
                                       StringValue str,
                                       Value encodingV,
                                       boolean isStrict)
Detects encoding of string.


mb_detect_order

public static Value mb_detect_order(Env env,
                                    Value encodingV)
Specifies order of charsets to test when detecting encoding.


mb_encode_mimeheader

public static StringValue mb_encode_mimeheader(Env env,
                                               StringValue str,
                                               java.lang.String charset,
                                               java.lang.String transfer_encoding,
                                               java.lang.String linefeed)
Encodes a string into mime.


mb_encode_numericentity

public static StringValue mb_encode_numericentity(Env env,
                                                  StringValue str,
                                                  ArrayValue convmap,
                                                  java.lang.String encoding)
Encodes HTML numeric string entity.


mb_ereg_match

public static BooleanValue mb_ereg_match(Env env,
                                         UnicodeEreg ereg,
                                         StringValue string,
                                         java.lang.String option)
Returns true if pattern matches a part of string.


mb_ereg_replace

public static Value mb_ereg_replace(Env env,
                                    Value eregValue,
                                    StringValue replacement,
                                    StringValue subject,
                                    java.lang.String option)
Multibyte version of ereg_replace.


mb_ereg

public static Value mb_ereg(Env env,
                            UnicodeEreg ereg,
                            StringValue string,
                            ArrayValue regs)
Multibyte version of ereg.


mb_eregi_replace

public static Value mb_eregi_replace(Env env,
                                     Value pattern,
                                     StringValue replacement,
                                     StringValue subject,
                                     java.lang.String option)
Multibyte version of eregi_replace.


mb_eregi

public static Value mb_eregi(Env env,
                             UnicodeEregi eregi,
                             StringValue string,
                             ArrayValue regs)
Multibyte version of eregi.


mb_ereg_search_getpos

public static LongValue mb_ereg_search_getpos(Env env)
Gets current position of ereg state object.


mb_ereg_search_getregs

public static Value mb_ereg_search_getregs(Env env)
Gets the last match of ereg state object from previous matching.


mb_ereg_search_init

public static BooleanValue mb_ereg_search_init(Env env,
                                               StringValue string,
                                               Value rawRegexp,
                                               Value option)
Initializes a ereg state object.


mb_ereg_search_pos

public static Value mb_ereg_search_pos(Env env,
                                       Value rawRegexp,
                                       Value option)
Returns index and position after matching.


mb_ereg_search_regs

public static Value mb_ereg_search_regs(Env env,
                                        Value rawRegexp,
                                        Value option)
Returns match array after matching.


mb_ereg_search_setpos

public static BooleanValue mb_ereg_search_setpos(Env env,
                                                 int position)
Sets the position of the ereg state object.


mb_ereg_search

public static BooleanValue mb_ereg_search(Env env,
                                          Value rawRegexp,
                                          Value option)
Returns whether or not pattern matches string.


mb_get_info

public static Value mb_get_info(Env env,
                                java.lang.String type)
Returns current mb settings.


mb_http_input

public static Value mb_http_input(Env env,
                                  java.lang.String type)
Returns and/or sets the http input encoding


mb_http_output

public static Value mb_http_output(Env env,
                                   java.lang.String encoding)
Returns and/or sets the http output encoding


mb_internal_encoding

public static Value mb_internal_encoding(Env env,
                                         java.lang.String encoding)
Returns and/or sets the internal encoding.


mb_language

public static Value mb_language(Env env,
                                java.lang.String language)
Returns and/or sets the encoding for mail.


mb_list_encodings

public static ArrayValue mb_list_encodings(Env env)
Get all supported encodings.


mb_output_handler

public static StringValue mb_output_handler(Env env,
                                            StringValue contents,
                                            int status)
ob_start() handler


mb_parse_str

public static BooleanValue mb_parse_str(Env env,
                                        StringValue strValue,
                                        Value result)
Multibyte version of parse_str.


mb_preferred_mime_name

public static StringValue mb_preferred_mime_name(Env env,
                                                 StringValue encoding)
Returns the preferred mime name of this encoding.


mb_regex_encoding

public static Value mb_regex_encoding(Env env,
                                      java.lang.String encoding)
Returns and/or sets encoding for mb regular expressions.


mb_regex_set_options

public static StringValue mb_regex_set_options(Env env,
                                               java.lang.String options)
XXX: what does this actually do?


mb_send_mail

public static BooleanValue mb_send_mail(Env env,
                                        StringValue to,
                                        StringValue subject,
                                        StringValue message,
                                        StringValue additionalHeaders,
                                        StringValue additionalParameters)
Multibyte version of mail.


mb_split

public static Value mb_split(Env env,
                             UnicodeEreg ereg,
                             StringValue string,
                             long limit)
Multibyte version of split.


mb_strcut

public static StringValue mb_strcut(Env env,
                                    StringValue str,
                                    int start,
                                    int length,
                                    java.lang.String encoding)
Similar to substr except start index is at the beginning of char boundaries.


mb_strimwidth

public static StringValue mb_strimwidth(Env env,
                                        StringValue str,
                                        int start,
                                        int width,
                                        StringValue trimmarker,
                                        java.lang.String encoding)
Truncates the string.


mb_strlen

public static LongValue mb_strlen(Env env,
                                  StringValue str,
                                  java.lang.String encoding)
Multibyte version of strlen.


mb_strpos

public static Value mb_strpos(Env env,
                              StringValue haystack,
                              StringValue needle,
                              int offset,
                              java.lang.String encoding)
Multibyte version of strpos.


mb_strrpos

public static Value mb_strrpos(Env env,
                               StringValue haystack,
                               StringValue needle,
                               Value offsetV,
                               java.lang.String encoding)
Multibyte version of strrpos.


mb_strtolower

public static StringValue mb_strtolower(Env env,
                                        StringValue str,
                                        java.lang.String encoding)
Converts all characters to lower-case.


mb_strtoupper

public static StringValue mb_strtoupper(Env env,
                                        StringValue str,
                                        java.lang.String encoding)
Converts all characters to upper-case.


mb_strwidth

public static LongValue mb_strwidth(Env env,
                                    StringValue str,
                                    java.lang.String encoding)
Returns the width of this multibyte string.


mb_substitute_character

public static Value mb_substitute_character(Value substrchar)
Sets the character to use when decoding/encoding fails on a character.


mb_substr_count

public static LongValue mb_substr_count(Env env,
                                        StringValue haystack,
                                        StringValue needle,
                                        java.lang.String encoding)

mb_substr

public static StringValue mb_substr(Env env,
                                    StringValue str,
                                    int start,
                                    Value lengthV,
                                    java.lang.String encoding)
Multibyte version of substr.


getEncoding

public static java.lang.String getEncoding(Env env)