Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.
If the asker does not get an answer then they have 10 days to request a refund.
$5
Handling Turkish characters
This question has been answered.
Lawrence Krubner | 03/01/10 at 3:58pm
Edit
(4) Possible Answers Submitted...
See a chronological view of answers?
Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.
-

Last edited:
03/05/10
3:00pmKiril Angov says:You need to make sure you database table use UTF-8. I am sure you use same HTML sanitizer for the input box to make sure you allow only the whitelisted tags, so make sure it is UTF-8 safe. Also try with other UTF-8 characters and see if they work.
-

Last edited:
03/01/10
6:40pmGert Findel says:Kiril is right about utf-8 encoding for the database and the site. Utf-8 is enough for Turkish
It looks like you are using like the slugify method from the jobeet tutorial chapter 8 (because its a permalink)
// code derived from http://php.vrana.cz/vytvoreni-pratelskeho-url.php
static public function slugify($text)
{
// replace non letter or digits by -
$text = preg_replace('~[^\\pL\d]+~u', '-', $text);
// trim
$text = trim($text, '-');
// transliterate
if (function_exists('iconv'))
{
$text = iconv('utf-8', 'us-ascii//TRANSLIT', $text);
}
// lowercase
$text = strtolower($text);
// remove unwanted characters
$text = preg_replace('~[^-\w]+~', '', $text);
if (empty($text))
{
return 'n-a';
}
return $text;
}
You might want to check that and correct properly not replacing the non-utf-8.
- 03/01/10 6:40pm
Gert Findel says:Kiril is right about utf-8 encoding for the database and the site. Utf-8 is enough for Turkish
It looks like you are using like the slugify method from the jobeet tutorial chapter 8 (because its a permalink)
// code derived from http://php.vrana.cz/vytvoreni-pratelskeho-url.php
static public function slugify($text)
{
// replace non letter or digits by -
$text = preg_replace('~[^\\pL\d]+~u', '-', $text);
// trim
$text = trim($text, '-');
// transliterate
if (function_exists('iconv'))
{
$text = iconv('utf-8', 'us-ascii//TRANSLIT', $text);
}
// lowercase
$text = strtolower($text);
// remove unwanted characters
$text = preg_replace('~[^-\w]+~', '', $text);
if (empty($text))
{
return 'n-a';
}
return $text;
}
You might want to check that and correct properly not replacing the non-utf-8.
- 03/01/10 6:43pm
Gert Findel says:Kiril is right about utf-8 encoding for the database and the site. Utf-8 is enough for Turkish
It looks like you are using like the slugify method from the jobeet tutorial chapter 8 (because its a permalink)
// code derived from http://php.vrana.cz/vytvoreni-pratelskeho-url.php
static public function slugify($text)
{
// replace non letter or digits by -
$text = preg_replace('~[^\\pL\d]+~u', '-', $text);
// trim
$text = trim($text, '-');
// transliterate
if (function_exists('iconv'))
{
$text = iconv('utf-8', 'us-ascii//TRANSLIT', $text);
}
// lowercase
$text = strtolower($text);
// remove unwanted characters
$text = preg_replace('~[^-\w]+~', '', $text);
if (empty($text))
{
return 'n-a';
}
return $text;
}
You might want to check that and correct properly not replacing the non-utf-8.
- 03/01/10 6:45pm
Gert Findel says:sorry for the repeated posting =(
Please delete if possible
- 03/01/10 6:40pm
-

Last edited:
03/02/10
3:32amTaboubi Issam says:all:
propel:
class: sfPropelDatabase
param:
dsn: mysqli://root:@localhost/databasename
encoding: utf8
make sure tp put enconding utf8 in your databases.yml
Previous versions of this answer: 03/02/10 at 3:33am
-

Last edited:
03/02/10
11:00amNirav Ranpara says:Hi Lawrence,
For Turkish character support you just need to follow bellow steps.
[1] You need to execute bellow query after open mysql connection.
"SET NAMES utf8"
OR
In symfony you need to put
encoding: utf8
in database.yml
[2] COLLATE=utf8_unicode_ci for specific fields in which you want to store Turkish or any character.
That's it.
I tested it and it working properly.
For any query please ask to me.
Regards
- Nirav Ranpara
This question has expired.
Current status of this question: Completed
Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.
If the asker does not get an answer then they have 10 days to request a refund.
