Class HTMLPurifier_Encoder

Description

A UTF-8 specific character encoder that handles cleaning and transforming.

Located in /lib/core/Parsers/htmlpurifier/HTMLPurifier.standalone.php (line 2836)


	
			
Method Summary
static void cleanUTF8 ( $str, [ $force_php = false])
static void convertFromUTF8 ( $str,  $config,  $context)
static ASCII convertToASCIIDumbLossless ($str $str)
static void convertToUTF8 ( $str,  $config,  $context)
static void muteErrorHandler ()
static Array testEncodingSupportsASCII (string $encoding, [bool $bypass = false])
static void unichr ( $code)
Methods
static method cleanUTF8 (line 2876)

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.

  • access: public
static void cleanUTF8 ( $str, [ $force_php = false])
  • $str
  • $force_php
static method convertFromUTF8 (line 3128)

Converts a string from UTF-8 based on configuration.

  • access: public
static void convertFromUTF8 ( $str,  $config,  $context)
  • $str
  • $config
  • $context
static method convertToASCIIDumbLossless (line 3174)

Lossless (character-wise) conversion of HTML to ASCII

  • return: encoded string with non-ASCII character entity-ized
  • access: public
static ASCII convertToASCIIDumbLossless ($str $str)
  • $str $str: UTF-8 string to be converted to ASCII
static method convertToUTF8 (line 3095)

Converts a string to UTF-8 based on configuration.

  • access: public
static void convertToUTF8 ( $str,  $config,  $context)
  • $str
  • $config
  • $context
static method muteErrorHandler (line 2849)

Error-handler that mutes errors, alternative to shut-up operator.

  • access: public
static void muteErrorHandler ()
static method testEncodingSupportsASCII (line 3216)

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.

  • return: of UTF-8 characters to their corresponding ASCII, which can be used to "undo" any overzealous iconv action.
  • access: public
static Array testEncodingSupportsASCII (string $encoding, [bool $bypass = false])
  • string $encoding: Encoding name to test, as per iconv format
  • bool $bypass: Whether or not to bypass the precompiled arrays.
static method unichr (line 3055)

Translates a Unicode codepoint into its corresponding UTF-8 character.

  • access: public
static void unichr ( $code)
  • $code

Documentation generated on Sun, 06 Mar 2011 00:24:05 -0500 by phpDocumentor 1.4.3