1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-21 21:21:54 +02:00

Issue #4101 toASCII characters added and test added to confirm.

This commit is contained in:
Cameron 2020-02-17 13:43:39 -08:00
parent df764389a8
commit 0dbad5d72b
2 changed files with 17 additions and 3 deletions

View File

@ -2182,7 +2182,9 @@ class e_parse extends e_parser
'Ā' => 'A', 'Č' => 'C', 'Ē' => 'E', 'Ģ' => 'G', 'Ī' => 'i', 'Ķ' => 'k', 'Ļ' => 'L', 'Ņ' => 'N',
'Š' => 'S', 'Ū' => 'u', 'Ž' => 'Z',
'ā' => '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);

View File

@ -185,12 +185,24 @@ TMP;
{
}
*/
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()
{