Skip to content
Snippets Groups Projects
Commit 5c9096af authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2361727 by rpayanm: Remove drupal_convert_to_utf8.

parent 45c6581c
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -112,29 +112,6 @@ function drupal_xml_parser_create(&$data) {
return $xml_parser;
}
/**
* Converts data to UTF-8.
*
* @param string $data
* The data to be converted.
* @param string $encoding
* The encoding that the data is in.
*
* @return string|bool
* Converted data or FALSE.
*
* @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.0.
* Use \Drupal\Component\Utility\Unicode::convertToUtf8().
*/
function drupal_convert_to_utf8($data, $encoding) {
$out = Unicode::convertToUtf8($data, $encoding);
if ($out === FALSE) {
\Drupal::logger('php')->error('Unsupported encoding %s. Please install iconv, GNU recode or mbstring for PHP.', array('%s' => $encoding));
}
return $out;
}
/**
* Truncates a UTF-8-encoded string safely to a number of bytes.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment