Skip to content

CI_Utf8

Mathieu Nayrolles edited this page Jan 20, 2016 · 1 revision

CI_Utf8

Utf8 Class

Provides support for UTF-8 environments

  • Class name: CI_Utf8
  • Namespace:

Methods

__construct

void CI_Utf8::__construct()

Class constructor

Determines if UTF-8 support is to be enabled.

  • Visibility: public

clean_string

string CI_Utf8::clean_string(string $str)

Clean UTF-8 strings

Ensures strings contain only valid UTF-8 characters.

  • Visibility: public

Arguments

  • $str string - <p>String to clean</p>

safe_ascii_for_xml

string CI_Utf8::safe_ascii_for_xml(string $str)

Remove ASCII control characters

Removes all ASCII control characters except horizontal tabs, line feeds, and carriage returns, as all others can cause problems in XML.

  • Visibility: public

Arguments

  • $str string - <p>String to clean</p>

convert_to_utf8

string CI_Utf8::convert_to_utf8(string $str, string $encoding)

Convert to UTF-8

Attempts to convert a string to UTF-8.

  • Visibility: public

Arguments

  • $str string - <p>Input string</p>
  • $encoding string - <p>Input encoding</p>

is_ascii

boolean CI_Utf8::is_ascii(string $str)

Is ASCII?

Tests if a string is standard 7-bit ASCII or not.

  • Visibility: public

Arguments

  • $str string - <p>String to check</p>
Clone this wiki locally