function Unicode::convertToUtf8
Converts data to UTF-8.
Requires the iconv, GNU recode or mbstring PHP extension.
Parameters
string $data: The data to be converted.
string $encoding: The encoding that the data is in.
Return value
string|bool Converted data or FALSE.
2 calls to Unicode::convertToUtf8()
- CssOptimizer::loadFile in core/
lib/ Drupal/ Core/ Asset/ CssOptimizer.php - Loads the stylesheet and resolves all @import commands.
- JsOptimizer::optimize in core/
lib/ Drupal/ Core/ Asset/ JsOptimizer.php - Optimizes an asset.
File
-
core/
lib/ Drupal/ Component/ Utility/ Unicode.php, line 186
Class
- Unicode
- Provides Unicode-related conversions and operations.
Namespace
Drupal\Component\UtilityCode
public static function convertToUtf8($data, $encoding) {
return @iconv($encoding, 'utf-8', $data);
}