Symfony 2 / Doctrine user-defined DQL functions parameter have string length limit? Symfony 2 / Doctrine user-defined DQL functions parameter have string length limit? symfony symfony

Symfony 2 / Doctrine user-defined DQL functions parameter have string length limit?


Like wrikken had already explained, Transliteration should be done using iconv since that will save your server resources.

here's a simple function that will transliterate (convert non latin characters to their closest representations in latin charset) a string.

function transliterateString($str){    $serverLocale = setlocale(LC_CTYPE, 0);    setlocale(LC_CTYPE, 'en_US.UTF8');    // transliterate the string using iconv    $str = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $str);     setlocale(LC_CTYPE, $serverLocale); //  return the locale to what it was before    return $str;}   

Usage:

$string = "café"; echo $string;echo transliterateString($string);

Above will output the below:

cafécafe