As discussed here on question2anser.org/qa, here is my resolution for this.
Edit file <<q2aHOME>>\qa-include\util\string.php
Add a new function qa_convert_vi_to_en
code:
function qa_convert_vi_to_en($str)
{
$str = preg_replace('/(à|á|?|?|ã|â|?|?|?|?|?|a|?|?|?|?|?)/', 'a', $str);
$str = preg_replace('/(è|é|?|?|?|ê|?|?|?|?|?)/', 'e', $str);
$str = preg_replace('/(ì|í|?|?|i)/', 'i', $str);
$str = preg_replace('/(ò|ó|?|?|õ|ô|?|?|?|?|?|o|?|?|?|?|?)/', 'o', $str);
$str = preg_replace('/(ù|ú|?|?|u|u|?|?|?|?|?)/', 'u', $str);
$str = preg_replace('/(?|ý|?|?|?)/', 'y', $str);
$str = preg_replace('/(d)/', 'd', $str);
$str = preg_replace('/(À|Á|?|?|Ã|Â|?|?|?|?|?|A|?|?|?|?|?)/', 'A', $str);
$str = preg_replace('/(È|É|?|?|?|Ê|?|?|?|?|?)/', 'E', $str);
$str = preg_replace('/(Ì|Í|?|?|I)/', 'I', $str);
$str = preg_replace('/(Ò|Ó|?|?|Õ|Ô|?|?|?|?|?|O|?|?|?|?|?)/', 'O', $str);
$str = preg_replace('/(Ù|Ú|?|?|U|U|?|?|?|?|?)/', 'U', $str);
$str = preg_replace('/(?|Ý|?|?|?)/', 'Y', $str);
$str = preg_replace('/(Ð)/', 'D', $str);
return $str;
}
- Update function
qa_string_remove_accents
to return with the newly created one.
code:
function qa_string_remove_accents($string)
/*
Return UTF-8 input $string with all accents (on Roman characters) removed
*/
{
if (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }
//global $qa_utf8removeaccents;
//return strtr($string, $qa_utf8removeaccents);
return qa_convert_vi_to_en($string);
}