Trustly/Data/data.php
public static function ensureUTF8($str) {
		if($str == NULL) {
			return NULL;
		}
		$enc = mb_detect_encoding($str, array('ISO-8859-1', 'ISO-8859-15', 'UTF-8', 'ASCII'));
		if($enc !== FALSE) {
			if($enc == 'ISO-8859-1' || $enc == 'ISO-8859-15') {
				$str = mb_convert_encoding($str, 'UTF-8', $enc);
			}
		}
		return $str;
	}
public static function ensureUTF8($str) {
		if($str == NULL) {
			return NULL;
		}
		$enc = mb_detect_encoding($str, array('ISO-8859-1', 'ISO-8859-15', 'UTF-8', 'ASCII'));
		if($enc !== FALSE) {
			if($enc == 'ISO-8859-1' || $enc == 'ISO-8859-15') {
				$str = mb_convert_encoding($str, 'UTF-8', $enc);
			}
		}
		return $str;
	}
public static function ensureUTF8 ( $ str ) { if ( $ str == NULL ) { return NULL ; } $ enc = mb_detect_encoding ( $ str , array ( 'ISO-8859-1' , 'ISO-8859-15' , 'UTF-8' , 'ASCII' ) ) ; if ( $ enc !== FALSE ) { if ( $ enc == 'ISO-8859-1' || $ enc == 'ISO-8859-15' ) { $ str = mb_convert_encoding ( $ str , 'UTF-8' , $ enc ) ; } } return $ str ; }
Function to ensure that the given value is in UTF8. Used to make sure
all outgoing data is properly encoded in the call

@param string $str String to process

@return string UTF-8 variant of string
Function to ensure that the given value is in UTF8 . Used to make sure all outgoing data is properly encoded in the call