Jump to content

Accents in posts urls


Durango

Recommended Posts

Hello,

We have a forum in french, and like in spanish or other latin languages we have accents in forum titles like : "Réseaux sociaux" which gives a weird url :

/communaute/forum/67-r%C3%A9seaux-sociaux

What we would like to have is :

/communaute/forum/67-reseaux-sociaux

How could we get that ? as it is much better to share the second url than the first one above

Tx for your help !

Link to comment
Share on other sites

Hi Ilya !

wow congrats for your plugin ! :)

so basically in french two letters with accents are very common : à and é

but just in case here is a good list :

à - a

â - a

ç - c

é - e

è - e

ê - e

ï - i

î - i

ô - o

û - u

and the same but in capital letters

EDIT : i just found a nice code, maybe using this would be easier for you :

function removeaccents($string) 
{  
        $string= strtr($string,  
      "ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ", 
      "aaaaaaaaaaaaooooooooooooeeeeeeeecciiiiiiiiuuuuuuuuynn");  
       
        return $string;  
}

this has the advantage to work for the following languages : French, Italian, Spanish :)

tell me if you need any other information, tx a lot ;)

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...