Monday, February 12, 2007

remove accents from strings using postgresql

function remove_accents(&$str)
{
return svq("select convert(TO_ASCII(convert('".pg_escape_string($str)."','UNICODE','LATIN 1'),'LATIN 1'),'LATIN 1','UNICODE');");
}

6 comments:

Unknown said...

svq?

Sergey said...

svq() is just a function i use to run queries in postgresQL

Unknown said...

Say, the way is the goal...

Do you have electricity in Russia?

And how does postgresql compare to MySQL??

Sergey said...

i currently do not live in Russia.
yes, they have electricity.
i dont understand your q about mysql.

Unknown said...

maybe another day, then.

Sergey said...

i suggest you check this link to find out about "postgresql compare to MySQL" - http://www.google.com/search?q=postgresql%20compare%20to%20MySQL