\CI_Utf8

Utf8 Class

Provides support for UTF-8 environments

Summary

Methods
Properties
Constants
__construct()
clean_string()
safe_ascii_for_xml()
convert_to_utf8()
_is_ascii()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

__construct()

__construct() 

Constructor

Determines if UTF-8 support is to be enabled

clean_string()

clean_string(  $str) : string

Clean UTF-8 strings

Ensures strings are UTF-8

Parameters

$str

Returns

string

safe_ascii_for_xml()

safe_ascii_for_xml(  $str) : string

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

Parameters

$str

Returns

string

convert_to_utf8()

convert_to_utf8(  $str,   $encoding) : string

Convert to UTF-8

Attempts to convert a string to UTF-8

Parameters

$str
$encoding

Returns

string

_is_ascii()

_is_ascii(  $str) : boolean

Is ASCII?

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

Parameters

$str

Returns

boolean