Elgg/Elgg — pull request #83 by Germanaz0 (2011-11-01 02:23:28+00:00)
Title: Elgg friendly title implementation

I have maden a support for friendly titles, about charsets. It put iconv support function and this work for people who have not installed iconv too, but the friendly titles are a litlte bit poor than people who have iconv.

I taken by reference the next urls:

http://www.symfony-project.org/jobeet/1_2/Propel/en/08#chapter_08_testing_slugify
http://cubiq.org/the-perfect-php-clean-url-generator

and my plugin http://community.elgg.org/pg/plugins/project/625760/developer/Germanaz0/seo-friendly-titles

some supported characters are

echo slugify("ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöùúûüýÿ");
//returns: aaaaaaaeceeeeiiiidnooooouuuuyssaaaaaaaeceeeeiiiidnooooouuuuyy

echo slugify("Tänk efter nu – förr'n vi föser dig bort"); // Swedish
//returns: tank-efter-nu-forrn-vi-foser-dig-

This feature should be tested in various servers with differents php versions, but it should work without any problem.

IMPORTANT:

The only change that I will make on this commit is about to put setlocale(LC_ALL, 'en_US.UTF8'); in settings.php or in some begin level.