ILIAS
eassessment Revision 61809
|
Static Public Member Functions | |
static | getIsMbstringEnabled () |
Get whether mbstring extension is available. | |
static | getIsIconvEnabled () |
Get whether iconv extension is available. | |
static | buildCharacterSets () |
static | ControlCharacterOOXML2PHP ($value= '') |
Convert from OpenXML escaped control character to PHP control character. | |
static | ControlCharacterPHP2OOXML ($value= '') |
Convert from PHP control character to OpenXML escaped control character. | |
static | SanitizeUTF8 ($value) |
Try to sanitize UTF8, stripping invalid byte sequences. | |
static | IsUTF8 ($value= '') |
Check if a string contains UTF8 data. | |
static | FormatNumber ($value) |
Formats a numeric value as a string for output in various output writers forcing point as decimal separator in case locale is other than English. | |
static | UTF8toBIFF8UnicodeShort ($value) |
Converts a UTF-8 string into BIFF8 Unicode string data (8-bit string length) Writes the string using uncompressed notation, no rich text, no Asian phonetics If mbstring extension is not available, ASCII is assumed, and compressed notation is used although this will give wrong results for non-ASCII strings see OpenOffice.org's Documentation of the Microsoft Excel File Format, sect. | |
static | UTF8toBIFF8UnicodeLong ($value) |
Converts a UTF-8 string into BIFF8 Unicode string data (16-bit string length) Writes the string using uncompressed notation, no rich text, no Asian phonetics If mbstring extension is not available, ASCII is assumed, and compressed notation is used although this will give wrong results for non-ASCII strings see OpenOffice.org's Documentation of the Microsoft Excel File Format, sect. | |
static | ConvertEncoding ($value, $to, $from) |
Convert string from one encoding to another. | |
static | utf16_decode ($str, $bom_be=true) |
Decode UTF-16 encoded strings. | |
static | CountCharacters ($value, $enc= 'UTF-8') |
Get character count. | |
static | Substring ($pValue= '', $pStart=0, $pLength=0) |
Get a substring of a UTF-8 encoded string. | |
static | convertToNumberIfFraction (&$operand) |
Identify whether a string contains a fractional numeric value, and convert it to a numeric if it is. | |
static | getDecimalSeparator () |
Get the decimal separator. | |
static | setDecimalSeparator ($pValue= '.') |
Set the decimal separator. | |
static | getThousandsSeparator () |
Get the thousands separator. | |
static | setThousandsSeparator ($pValue= ',') |
Set the thousands separator. | |
static | getCurrencyCode () |
Get the currency code. | |
static | setCurrencyCode ($pValue= '$') |
Set the currency code. | |
static | SYLKtoUTF8 ($pValue= '') |
Convert SYLK encoded string to UTF-8. |
Data Fields | |
const | STRING_REGEXP_FRACTION = '(-?)(\d+)\s+(\d+\/\d+)' |
Constants. |
Static Private Member Functions | |
static | _buildControlCharacters () |
Build control characters array. | |
static | _buildSYLKCharacters () |
Build SYLK characters array. |
Static Private Attributes | |
static | $_controlCharacters = array() |
static | $_SYLKCharacters = array() |
SYLK Characters array. | |
static | $_decimalSeparator |
static | $_thousandsSeparator |
static | $_currencyCode |
static | $_isMbstringEnabled |
static | $_isIconvEnabled |
Definition at line 36 of file String.php.
|
staticprivate |
Build control characters array.
Definition at line 96 of file String.php.
Referenced by buildCharacterSets().
|
staticprivate |
Build SYLK characters array.
Definition at line 109 of file String.php.
Referenced by buildCharacterSets().
|
static |
Definition at line 332 of file String.php.
References _buildControlCharacters(), and _buildSYLKCharacters().
|
static |
Convert from OpenXML escaped control character to PHP control character.
That's correct, control characters are stored directly in the shared-strings table. We do encode characters that cannot be represented in XML using the following escape sequence: xHHHH where H represents a hexadecimal character in the character's value... So you could end up with something like x0008 in a string (either in a cell value (<v>) element or in the shared string <t> element.
string | $value | Value to unescape |
Definition at line 355 of file String.php.
Referenced by PHPExcel_Reader_Excel2007\_parseRichText(), and PHPExcel_Reader_Excel2007\load().
|
static |
Convert from PHP control character to OpenXML escaped control character.
That's correct, control characters are stored directly in the shared-strings table. We do encode characters that cannot be represented in XML using the following escape sequence: xHHHH where H represents a hexadecimal character in the character's value... So you could end up with something like x0008 in a string (either in a cell value (<v>) element or in the shared string <t> element.
string | $value | Value to escape |
Definition at line 373 of file String.php.
Referenced by PHPExcel_Writer_Excel2007_Worksheet\_writeCell(), PHPExcel_Writer_Excel2007_StringTable\writeRichText(), and PHPExcel_Writer_Excel2007_StringTable\writeStringTable().
|
static |
Convert string from one encoding to another.
First try iconv, then mbstring, or no convertion
string | $value | |
string | $to | Encoding to convert to, e.g. 'UTF-8' |
string | $from | Encoding to convert from, e.g. 'UTF-16LE' |
Definition at line 483 of file String.php.
References utf16_decode().
Referenced by PHPExcel_Reader_Excel5\_decodeCodepage(), PHPExcel_Reader_Excel5\_encodeUTF16(), PHPExcel_Reader_Excel5\_readDocumentSummaryInformation(), PHPExcel_Reader_Excel5\_readSummaryInformation(), PHPExcel_Writer_Excel5_Worksheet\_writeUrlInternal(), PHPExcel_Reader_CSV\loadIntoExisting(), UTF8toBIFF8UnicodeLong(), and UTF8toBIFF8UnicodeShort().
|
static |
Identify whether a string contains a fractional numeric value, and convert it to a numeric if it is.
string | &$operand | string value to test |
Definition at line 585 of file String.php.
References PHPExcel_Calculation\getInstance().
Referenced by PHPExcel_Calculation\_validateBinaryOperand(), PHPExcel_Shared_JAMA_Matrix\arrayRightDivide(), PHPExcel_Shared_JAMA_Matrix\arrayTimesEquals(), PHPExcel_Shared_JAMA_Matrix\minusEquals(), PHPExcel_Shared_JAMA_Matrix\plusEquals(), and PHPExcel_Shared_JAMA_Matrix\power().
|
static |
Get character count.
First try mbstring, then iconv, finally strlen
string | $value | |
string | $enc | Encoding |
Definition at line 541 of file String.php.
References $enc.
Referenced by PHPExcel_Worksheet\_checkSheetTitle(), PHPExcel_Reader_Excel5\_readLabelSst(), PHPExcel_Writer_Excel5_Worksheet\_writeUrlInternal(), PHPExcel_Shared_Font\getTextWidthPixelsApprox(), PHPExcel_Worksheet\setTitle(), UTF8toBIFF8UnicodeLong(), and UTF8toBIFF8UnicodeShort().
|
static |
Formats a numeric value as a string for output in various output writers forcing point as decimal separator in case locale is other than English.
mixed | $value |
Definition at line 416 of file String.php.
Referenced by PHPExcel_Writer_Excel2007_Worksheet\_writeCell(), PHPExcel_Writer_Excel2007_Worksheet\_writeCols(), PHPExcel_Writer_Excel2007_Worksheet\_writePageMargins(), PHPExcel_Writer_Excel2007_Worksheet\_writeSheetData(), and PHPExcel_Writer_Excel2007_Worksheet\_writeSheetFormatPr().
|
static |
Get the currency code.
If it has not yet been set explicitly, try to obtain the symbol information from locale.
Definition at line 660 of file String.php.
References $_currencyCode.
Referenced by PHPExcel_Style_NumberFormat\toFormattedString().
|
static |
Get the decimal separator.
If it has not yet been set explicitly, try to obtain number formatting information from locale.
Definition at line 601 of file String.php.
References $_decimalSeparator.
Referenced by PHPExcel_Style_NumberFormat\toFormattedString().
|
static |
Get whether iconv extension is available.
Definition at line 293 of file String.php.
References $_isIconvEnabled.
Referenced by UTF8toBIFF8UnicodeLong(), and UTF8toBIFF8UnicodeShort().
|
static |
Get whether mbstring extension is available.
Definition at line 276 of file String.php.
References $_isMbstringEnabled.
Referenced by UTF8toBIFF8UnicodeLong(), and UTF8toBIFF8UnicodeShort().
|
static |
Get the thousands separator.
If it has not yet been set explicitly, try to obtain number formatting information from locale.
Definition at line 633 of file String.php.
References $_thousandsSeparator.
Referenced by PHPExcel_Style_NumberFormat\toFormattedString().
|
static |
Check if a string contains UTF8 data.
string | $value |
Definition at line 405 of file String.php.
|
static |
Try to sanitize UTF8, stripping invalid byte sequences.
Not perfect. Does not surrogate characters.
string | $value |
Definition at line 383 of file String.php.
Referenced by PHPExcel_Cell_AdvancedValueBinder\bindValue(), and PHPExcel_Cell_DefaultValueBinder\bindValue().
|
static |
Set the currency code.
Only used by PHPExcel_Style_NumberFormat::toFormattedString() to format output by PHPExcel_Writer_HTML and PHPExcel_Writer_PDF
string | $pValue | Character for currency code |
Definition at line 681 of file String.php.
|
static |
Set the decimal separator.
Only used by PHPExcel_Style_NumberFormat::toFormattedString() to format output by PHPExcel_Writer_HTML and PHPExcel_Writer_PDF
string | $pValue | Character for decimal separator |
Definition at line 622 of file String.php.
|
static |
Set the thousands separator.
Only used by PHPExcel_Style_NumberFormat::toFormattedString() to format output by PHPExcel_Writer_HTML and PHPExcel_Writer_PDF
string | $pValue | Character for thousands separator |
Definition at line 649 of file String.php.
|
static |
Get a substring of a UTF-8 encoded string.
string | $pValue | UTF-8 encoded string |
int | $start | Start offset |
int | $length | Maximum number of characters in substring |
Definition at line 563 of file String.php.
Referenced by PHPExcel_Reader_Excel5\_readLabelSst(), PHPExcel_Cell_DataType\checkString(), and PHPExcel_Worksheet\setTitle().
|
static |
Convert SYLK encoded string to UTF-8.
string | $pValue |
Definition at line 692 of file String.php.
Referenced by PHPExcel_Reader_SYLK\loadIntoExisting().
|
static |
Decode UTF-16 encoded strings.
Can handle both BOM'ed data and un-BOM'ed data. Assumes Big-Endian byte order if no BOM is available. This function was taken from http://php.net/manual/en/function.utf8-decode.php and $bom_be parameter added.
string | $str | UTF-16 encoded data to decode. |
Definition at line 518 of file String.php.
Referenced by ConvertEncoding().
|
static |
Converts a UTF-8 string into BIFF8 Unicode string data (16-bit string length) Writes the string using uncompressed notation, no rich text, no Asian phonetics If mbstring extension is not available, ASCII is assumed, and compressed notation is used although this will give wrong results for non-ASCII strings see OpenOffice.org's Documentation of the Microsoft Excel File Format, sect.
2.5.3
string | $value | UTF-8 encoded string |
Definition at line 459 of file String.php.
References $data, ConvertEncoding(), CountCharacters(), getIsIconvEnabled(), and getIsMbstringEnabled().
Referenced by PHPExcel_Writer_Excel5_Worksheet\_writeDataValidity(), PHPExcel_Writer_Excel5_Worksheet\_writeFooter(), PHPExcel_Writer_Excel5_Worksheet\_writeHeader(), PHPExcel_Writer_Excel5_Worksheet\_writeLabelSst(), PHPExcel_Writer_Excel5_Worksheet\_writeRangeProtection(), and PHPExcel_Writer_Excel5_Worksheet\_writeStringRecord().
|
static |
Converts a UTF-8 string into BIFF8 Unicode string data (8-bit string length) Writes the string using uncompressed notation, no rich text, no Asian phonetics If mbstring extension is not available, ASCII is assumed, and compressed notation is used although this will give wrong results for non-ASCII strings see OpenOffice.org's Documentation of the Microsoft Excel File Format, sect.
2.5.3
string | $value | UTF-8 encoded string |
Definition at line 433 of file String.php.
References $data, ConvertEncoding(), CountCharacters(), getIsIconvEnabled(), and getIsMbstringEnabled().
Referenced by PHPExcel_Writer_Excel5_Workbook\_calcSheetOffsets(), PHPExcel_Writer_Excel5_Parser\_convertString(), and PHPExcel_Writer_Excel5_Font\writeFont().
|
staticprivate |
Definition at line 49 of file String.php.
|
staticprivate |
Definition at line 77 of file String.php.
Referenced by getCurrencyCode().
|
staticprivate |
Definition at line 63 of file String.php.
Referenced by getDecimalSeparator().
|
staticprivate |
Definition at line 91 of file String.php.
Referenced by getIsIconvEnabled().
|
staticprivate |
Definition at line 84 of file String.php.
Referenced by getIsMbstringEnabled().
|
staticprivate |
|
staticprivate |
Definition at line 70 of file String.php.
Referenced by getThousandsSeparator().
const PHPExcel_Shared_String::STRING_REGEXP_FRACTION = '(-?)(\d+)\s+(\d+\/\d+)' |