The following warnings occurred:
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message



GetSimple Support Forum
QUESTION Make URL not remove Unicode chars? - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16)
+--- Thread: QUESTION Make URL not remove Unicode chars? (/showthread.php?tid=7543)



Make URL not remove Unicode chars? - jontrac - 2015-09-12

Hi guys,

I'm currently having a problem with my website url.

For example, if the age title is: đường dẫn

By default, the script will remove all the non-latin chars and make the link become:

http://demo.com/ng-dn (with the "đ, ư, ờ, ẫn removed)

Normally, I would implement the following script to make the url become:
http://demo.com/duong-dan

Code:
<?php

 $sContent=str_replace(array("á","à","ả","ã","ạ","ă","ắ","ằ","ẳ","ẵ","ặ","â","ấ","ầ","ẩ","ẫ","ậ"), "a", $sContent);
 $sContent=str_replace(array("Á","À","Ả","Ã","Ạ","Ă","Ắ","Ằ","Ẳ","Ẵ","Ặ","Â","Ấ","Ầ","Ẩ","Ẫ","Ậ"), "a", $sContent);
 $sContent=str_replace(array("é","è","ẻ","ẽ","ẹ","ê","ế","ề","ể","ễ","ệ"), "e", $sContent);
 $sContent=str_replace(array("É","È","Ẻ","Ẽ","Ẹ","Ê","Ế","Ề","Ể","Ễ","Ệ"), "e", $sContent);
 $sContent=str_replace(array("í","ì","ỉ","ĩ","ị"), "i", $sContent);
 $sContent=str_replace(array("Í","Ì","Ỉ","Ĩ","Ị"), "i", $sContent);
 $sContent=str_replace(array("ó","ò","ỏ","õ","ọ","ô","ố","ồ","ổ","ỗ","ộ","ơ","ớ","ờ","ở","ỡ","ợ"), "o", $sContent);
 $sContent=str_replace(array("Ó","Ò","Ỏ","Õ","Ọ","Ô","Ố","Ồ","Ổ","Ỗ","Ộ","Ơ","Ớ","Ờ","Ở","Ỡ","Ợ"), "o", $sContent);
 $sContent=str_replace(array("ú","ù","ủ","ũ","ụ","ư","ứ","ừ","ử","ữ","ự"), "u", $sContent);
 $sContent=str_replace(array("Ú","Ù","Ủ","Ũ","Ụ","Ư","Ứ","Ừ","Ử","Ữ","Ự"), "u", $sContent);
 $sContent=str_replace(array("ý","ỳ","ỷ","ỹ","ỵ"), "y", $sContent);
 $sContent=str_replace(array("Ý","Ỳ","Ỷ","Ỹ","Ỵ"), "y", $sContent);
 $sContent=str_replace("đ", "d", $sContent);
 $sContent=str_replace("Đ", "d", $sContent);

?>

Please assist how can I do this. Otherwise, the url is totally broken for my website. They are meaningless.

Thanks.


RE: Make URL not remove Unicode chars? - Carlos - 2015-09-12

A way to add slug transliteration support for your language is making a plugin for that.
I made one for Roman languages, that you could rename and change to what you need:
http://get-simple.info/forums/showthread.php?tid=4052


RE: Make URL not remove Unicode chars? - jontrac - 2015-09-12

You are my saver bro. Great appreciation from me! Thank you very much!