public function Cleantalk::stringFromUTF8 in Anti Spam by CleanTalk 7.5
Same name and namespace in other branches
- 7 cleantalk.module \Cleantalk::stringFromUTF8()
- 7.2 cleantalk.module \Cleantalk::stringFromUTF8()
- 7.4 src/Cleantalk.php \Cleantalk::stringFromUTF8()
Function convert string from UTF8 param string param string
Return value
string
1 call to Cleantalk::stringFromUTF8()
- Cleantalk::httpRequest in src/
Cleantalk.php - httpRequest
File
- src/
Cleantalk.php, line 681
Class
- Cleantalk
- Cleantalk Base class
Code
public function stringFromUTF8($str, $data_codepage = null) {
if (preg_match('//u', $str) && function_exists('mb_convert_encoding') && $data_codepage !== null) {
return mb_convert_encoding($str, $data_codepage, 'UTF-8');
}
return $str;
}