FOSSology  4.4.0
Open Source License Compliance by Open Source Software
common-string.php File Reference

Common function to handle strings. More...

Go to the source code of this file.

Functions

if(! defined('ENT_SUBSTITUTE')) convertToUTF8 ($content, $toHTML=true)
 
 checkUTF8 ($content)
 
 tryConvertToUTF8 ($content)
 

Detailed Description

Common function to handle strings.

Definition in file common-string.php.

Function Documentation

◆ checkUTF8()

checkUTF8 (   $content)

Check if the given string is already UTF-8 encoded

Parameters
string$contentString to check
Returns
boolean True if encoded in UTF-8, false otherwise

Definition at line 50 of file common-string.php.

◆ convertToUTF8()

if (! defined( 'ENT_SUBSTITUTE')) convertToUTF8 (   $content,
  $toHTML = true 
)

Convert string to UTF-8

Parameters
string$contentString to be converted
bool$toHTMLTrue to return HTML compatible strings
Returns
string UTF8 converted string

Definition at line 25 of file common-string.php.

◆ tryConvertToUTF8()

tryConvertToUTF8 (   $content)

Try to convert a string to UTF-8 encoded string

Parameters
string$contentString to be converted
Returns
boolean|string UTF-8 converted string, false if cannot be converted

Definition at line 60 of file common-string.php.