Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
1.1k views
in Q2A Core by
I have a Q2A in portuguese but im having problems with urls. Example:
Here is the question:
Quando o iPad foi lançado oficialmente?
Here is the url:
http://localhost/5/quando-o-ipad-foi-lan%EF%BF%BDado-oficialmente

How can I fix that?

2 Answers

0 votes
by
by
thanks but it still did not resolved my issue! Still same result
Question this:
Relações extraconjugais é um caso sério
Url this:
http://localhost/6/rela%E3%A7%E3%B5es-extraconjugais-%E3%A9-um-caso-s%E3%A9rio
0 votes
by
As far as I can see, that URL is appropriate for the question text. It will appear in most modern web browsers without the % symbols, but rather as the accented Portugese characters. Is the page not being displayed for the URL?
by
Cool! It wont have a negative effect on the title, but yes on the url... anyways thanks!
by
I found this code below:

function make_friendly_URL($input) {
    $trans = array("¥" => "Y", "µ" => "u", "À" => "A", "Á" => "A", "Â" => "A", "Ã" => "A", "Ä" => "A", "Å" => "A", "Æ" => "A", "Ç" => "C", "È" => "E", "É" => "E", "Ê" => "E", "Ë" => "E", "Ì" => "I", "Í" => "I", "Î" => "I", "Ï" => "I", "Ð" => "D", "Ñ" => "N", "Ò" => "O", "Ó" => "O", "Ô" => "O", "Õ" => "O", "Ö" => "O", "Ø" => "O", "Ù" => "U", "Ú" => "U", "Û" => "U", "Ü" => "U", "Ý" => "Y", "ß" => "s", "à" => "a", "á" => "a", "â" => "a", "ã" => "a", "ä" => "a", "å" => "a", "æ" => "a", "ç" => "c", "è" => "e", "é" => "e", "ê" => "e", "ë" => "e", "ì" => "i", "í" => "i", "î" => "i", "ï" => "i", "ð" => "o", "ñ" => "n", "ò" => "o", "ó" => "o", "ô" => "o", "õ" => "o", "ö" => "o", "ø" => "o", "ù" => "u", "ú" => "u", "û" => "u", "ü" => "u", "ý" => "y", "ÿ" => "y", "I'll" => "I+will", "'" => "+", "(" => "", ")" => "", "!" => "", " " => "+", " - " => "+/+");
    $input = strtr($input, $trans);
    return $input;
}

maybe the solution?
by
That looks like it will work - you could just add that function to qa-base.php then insert this line at the start of qa_q_request():

$title=make_friendly_URL($title);

But: make sure you are editing qa-base.php with UTF-8 text encoding in your text editor, otherwise the character substitutions will be stored wrongly in the PHP file.
by
That is it!!! it fixed!!! Thanks for your support!
...