Feature Requests
Share ideas, discuss and vote on requests from other users in community
 

About ModRewriteFriendlyString Utf-8

zobibobo shared this idea 6 years ago
Under Consideration

Replace in whcsm/includes/functinons.php code:

  1. $title = foreignchrreplace($title);
  2. $title = str_replace("#", "sharp", $title);
  3. $title = str_replace(""", "", $title);
  4. $title = str_replace("/", "or", $title);
  5. $title = str_replace("&", "and", $title);
  6. $title = str_replace("&", "and", $title);
  7. $title = str_replace("+", "plus", $title);
  8. $title = str_replace("=", "equals", $title);
  9. $title = str_replace("@", "at", $title);
  10. $title = str_replace(" ", "-", $title);
  11. $title = preg_replace("/[^0-9a-zA-Z-]/i", "", $title);
  12. return $title;*/

By:

  1. $str = preg_replace("/(à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ)/", 'a', $str);
  2. $str = preg_replace("/(è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ)/", 'e', $str);
  3. $str = preg_replace("/(ì|í|ị|ỉ|ĩ)/", 'i', $str);
  4. $str = preg_replace("/(ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ)/", 'o', $str);
  5. $str = preg_replace("/(ù|ú|ụ|ủ|ũ|ư|ừ|ứ|ự|ử|ữ)/", 'u', $str);
  6. $str = preg_replace("/(ỳ|ý|ỵ|ỷ|ỹ)/", 'y', $str);
  7. $str = preg_replace("/(Ä‘)/", 'd', $str);
  8. $str = preg_replace("/(À|Á|Ạ|Ả|Ã|Â|Ầ|Ấ|Ậ|Ẩ|Ẫ|Ă|Ằ|Ắ|Ặ|Ẳ|Ẵ)/", 'A', $str);
  9. $str = preg_replace("/(È|É|Ẹ|Ẻ|Ẽ|Ê|Ề|Ế|Ệ|Ể|Ễ)/", 'E', $str);
  10. $str = preg_replace("/(Ì|Í|Ị|Ỉ|Ĩ)/", 'I', $str);
  11. $str = preg_replace("/(Ò|Ó|Ọ|Ỏ|Õ|Ô|Ồ|Ố|Ộ|Ổ|Ỗ|Ơ|Ờ|Ớ|Ợ|Ở|Ỡ)/", 'O', $str);
  12. $str = preg_replace("/(Ù|Ú|Ụ|Ủ|Ũ|Ư|Ừ|Ứ|Ự|Ử|Ữ)/", 'U', $str);
  13. $str = preg_replace("/(Ỳ|Ý|Ỵ|Ỷ|Ỹ)/", 'Y', $str);
  14. $str = preg_replace("/(Đ)/", 'D', $str);
  15. $str = preg_replace("/( )/", '-', $str);
  16. return $str;

Or another code to rewrite url with utf-8 Latin language. Please update it...

Regards

Comments (1)