Öffentliche, statische Methoden | |
static | muteErrorHandler () |
static | unsafeIconv ($in, $out, $text) |
static | iconv ($in, $out, $text, $max_chunk_size=8000) |
static | cleanUTF8 ($str, $force_php=false) |
static | unichr ($code) |
static | iconvAvailable () |
static | convertToUTF8 ($str, $config, $context) |
static | convertFromUTF8 ($str, $config, $context) |
static | convertToASCIIDumbLossless ($str) |
static | testIconvTruncateBug () |
static | testEncodingSupportsASCII ($encoding, $bypass=false) |
Datenfelder | |
const | ICONV_OK = 0 |
const | ICONV_TRUNCATES = 1 |
const | ICONV_UNUSABLE = 2 |
Private Methoden | |
__construct () | |
A UTF-8 specific character encoder that handles cleaning and transforming.
Definiert in Zeile 7 der Datei Encoder.php.
|
private |
Constructor throws fatal error if you attempt to instantiate class
Definiert in Zeile 13 der Datei Encoder.php.
|
static |
Cleans a UTF-8 string for well-formedness and SGML validity
It will parse according to UTF-8 and return a valid UTF8 string, with non-SGML codepoints excluded.
string | $str | The string to clean |
bool | $force_php |
Definiert in Zeile 127 der Datei Encoder.php.
Wird benutzt von HTMLPurifier_Printer\escape(), HTMLPurifier_AttrDef\expandCSSEscape() und HTMLPurifier_Lexer\normalize().
|
static |
Converts a string from UTF-8 based on configuration.
string | $str | The string to convert |
HTMLPurifier_Config | $config | |
HTMLPurifier_Context | $context |
Definiert in Zeile 420 der Datei Encoder.php.
Wird benutzt von HTMLPurifier\purify().
|
static |
Lossless (character-wise) conversion of HTML to ASCII
string | $str | UTF-8 string to be converted to ASCII |
Definiert in Zeile 474 der Datei Encoder.php.
|
static |
Convert a string to UTF-8 based on configuration.
string | $str | The string to convert |
HTMLPurifier_Config | $config | |
HTMLPurifier_Context | $context |
Definiert in Zeile 372 der Datei Encoder.php.
Benutzt testIconvTruncateBug().
Wird benutzt von HTMLPurifier\purify().
|
static |
iconv wrapper which mutes errors and works around bugs.
string | $in | Input encoding |
string | $out | Output encoding |
string | $text | The text to convert |
int | $max_chunk_size |
Definiert in Zeile 48 der Datei Encoder.php.
Wird benutzt von unsafeIconv().
|
static |
Definiert in Zeile 356 der Datei Encoder.php.
|
static |
Error-handler that mutes errors, alternative to shut-up operator.
Definiert in Zeile 21 der Datei Encoder.php.
|
static |
This expensive function tests whether or not a given character encoding supports ASCII. 7/8-bit encodings like Shift_JIS will fail this test, and require special processing. Variable width encodings shouldn't ever fail.
string | $encoding | Encoding name to test, as per iconv format |
bool | $bypass | Whether or not to bypass the precompiled arrays. |
Definiert in Zeile 565 der Datei Encoder.php.
|
static |
glibc iconv has a known bug where it doesn't handle the magic //IGNORE stanza correctly. In particular, rather than ignore characters, it will return an EILSEQ after consuming some number of characters, and expect you to restart iconv as if it were an E2BIG. Old versions of PHP did not respect the errno, and returned the fragment, so as a result you would see iconv mysteriously truncating output. We can work around this by manually chopping our input into segments of about 8000 characters, as long as PHP ignores the error code. If PHP starts paying attention to the error code, iconv becomes unusable.
Definiert in Zeile 531 der Datei Encoder.php.
Wird benutzt von convertToUTF8().
|
static |
Translates a Unicode codepoint into its corresponding UTF-8 character.
Definiert in Zeile 309 der Datei Encoder.php.
Wird benutzt von HTMLPurifier_AttrDef\expandCSSEscape() und HTMLPurifier_EntityParser\nonSpecialEntityCallback().
|
static |
iconv wrapper which mutes errors, but doesn't work around bugs.
string | $in | Input encoding |
string | $out | Output encoding |
string | $text | The text to convert |
Definiert in Zeile 32 der Datei Encoder.php.
Benutzt iconv().
const ICONV_OK = 0 |
No bugs detected in iconv.
Definiert in Zeile 507 der Datei Encoder.php.
const ICONV_TRUNCATES = 1 |
Iconv truncates output if converting from UTF-8 to another character set with //IGNORE, and a non-encodable character is found
Definiert in Zeile 511 der Datei Encoder.php.
const ICONV_UNUSABLE = 2 |
Iconv does not support //IGNORE, making it unusable for transcoding purposes
Definiert in Zeile 515 der Datei Encoder.php.