function UnicodeTest::testConvertToUtf8
Same name in other branches
- 9 core/tests/Drupal/Tests/Component/Utility/UnicodeTest.php \Drupal\Tests\Component\Utility\UnicodeTest::testConvertToUtf8()
- 10 core/tests/Drupal/Tests/Component/Utility/UnicodeTest.php \Drupal\Tests\Component\Utility\UnicodeTest::testConvertToUtf8()
- 11.x core/tests/Drupal/Tests/Component/Utility/UnicodeTest.php \Drupal\Tests\Component\Utility\UnicodeTest::testConvertToUtf8()
Tests UTF-8 conversion.
@dataProvider providerTestConvertToUtf8 @covers ::convertToUtf8
Parameters
string $data: The data to be converted.
string $encoding: The encoding the data is in.
string|bool $expected: The expected result.
File
-
core/
tests/ Drupal/ Tests/ Component/ Utility/ UnicodeTest.php, line 495
Class
- UnicodeTest
- Test unicode handling features implemented in Unicode component.
Namespace
Drupal\Tests\Component\UtilityCode
public function testConvertToUtf8($data, $encoding, $expected) {
$this->assertEquals($expected, Unicode::convertToUtf8($data, $encoding));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.