mirror of
https://github.com/e107inc/e107.git
synced 2025-07-11 18:16:21 +02:00
Issue #4101 toASCII characters added and test added to confirm.
This commit is contained in:
@ -2182,7 +2182,9 @@ class e_parse extends e_parser
|
|||||||
'Ā' => 'A', 'Č' => 'C', 'Ē' => 'E', 'Ģ' => 'G', 'Ī' => 'i', 'Ķ' => 'k', 'Ļ' => 'L', 'Ņ' => 'N',
|
'Ā' => 'A', 'Č' => 'C', 'Ē' => 'E', 'Ģ' => 'G', 'Ī' => 'i', 'Ķ' => 'k', 'Ļ' => 'L', 'Ņ' => 'N',
|
||||||
'Š' => 'S', 'Ū' => 'u', 'Ž' => 'Z',
|
'Š' => 'S', 'Ū' => 'u', 'Ž' => 'Z',
|
||||||
'ā' => 'a', 'č' => 'c', 'ē' => 'e', 'ģ' => 'g', 'ī' => 'i', 'ķ' => 'k', 'ļ' => 'l', 'ņ' => 'n',
|
'ā' => 'a', 'č' => 'c', 'ē' => 'e', 'ģ' => 'g', 'ī' => 'i', 'ķ' => 'k', 'ļ' => 'l', 'ņ' => 'n',
|
||||||
'š' => 's', 'ū' => 'u', 'ž' => 'z'
|
'š' => 's', 'ū' => 'u', 'ž' => 'z',
|
||||||
|
|
||||||
|
'ľ' => 'l', 'ŕ'=>'r',
|
||||||
);
|
);
|
||||||
|
|
||||||
return str_replace(array_keys($char_map), $char_map, $text);
|
return str_replace(array_keys($char_map), $char_map, $text);
|
||||||
|
@ -185,12 +185,24 @@ TMP;
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
public function testToASCII()
|
public function testToASCII()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
$array = array(
|
||||||
|
array('input' => 'ľ, ú, ŕ, ô, ť', 'expected' => 'l, u, r, o, t'),
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach($array as $arr)
|
||||||
|
{
|
||||||
|
$result = $this->tp->toASCII($arr['input']);
|
||||||
|
$this->assertEquals($arr['expected'], $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
/*
|
||||||
public function testToNumber()
|
public function testToNumber()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user