View Full Version : Problem in Arabic characters in mysql
Mido™
10-21-2009, 06:48 PM
I have to insert the Arabian characters in my database and I don't know how.
after I insert them when I select them I found a strange characters and I don't get the words.
hope if any one have a solution for this that make me able to insert and select both of Arabian and English characters.
ckeyrouz
10-21-2009, 06:56 PM
Your database should have the UTF-8 character encoding and your web pages as well.
Mido™
10-21-2009, 11:02 PM
Your database should have the UTF-8 character encoding and your web pages as well.
the both are encoding to UTF-8 .
abduraooft
10-22-2009, 09:59 AM
http://www.codingforums.com/showthread.php?t=149224 may help.
Mido™
10-22-2009, 07:00 PM
http://www.codingforums.com/showthread.php?t=149224 may help.
it helped but not by 100%.
now after I set the query mysql_query("SET NAMES 'utf8'"); and set the unicode of the pages to utf8, the arabic characters problem fixed but with only the arabic character that come from the database!
when I write any arabic character in the page it show in a strange characters and didn't show well unless I change the unicode of the page to windows-1256,and in that case the arabic character of the database don't show well.
are you could help me in this?
abduraooft
10-23-2009, 08:54 AM
If you want to write static unicode characters into a file, you must first change the formatting of that file from ANSI(which might be the default) to unicode.
You may do it in notepad by taking the "Save as" option and then choosing the utf-8 from the encoding drop down. In notepad++, the option is directly under the "Format" tab.
Mido™
10-23-2009, 01:12 PM
if you want to write static unicode characters into a file, you must first change the formatting of that file from ansi(which might be the default) to unicode.
You may do it in notepad by taking the "save as" option and then choosing the utf-8 from the encoding drop down. In notepad++, the option is directly under the "format" tab.
استاذ
abduraooft
10-23-2009, 01:19 PM
استاذ
:d ...لول
Mido™
10-24-2009, 04:34 PM
I got another problem in this issue but this time it's about the encode and session in php files.
when I make the file format in utf-8 I get this error message:
Warning: session_start() Cannot send session cache limiter - headers already sent
abduraooft
10-24-2009, 04:57 PM
It's due to the BOM (http://en.wikipedia.org/wiki/Byte-order_mark). You may save your file by choosing "UTF-8 without BOM" in notepad++.
Mido™
10-24-2009, 06:17 PM
It's due to the BOM (http://en.wikipedia.org/wiki/Byte-order_mark). You may save your file by choosing "UTF-8 without BOM" in notepad++.
No I saved them by choosing UTF-8 , when I saved them by by choosing "UTF-8 without BOM" in notepad++ the session problem didn't come but the page encoding in this case didn't be utf-8.
but I found now that it work well on the server and this problem happen only in my localhost!
coloradorockies
03-23-2011, 06:00 PM
I have to insert the Arabian characters in my database and I don't know how.
after I insert them when I select them I found a strange characters and I don't get the words.
hope if any one have a solution for this that make me able to insert and select both of Arabian and English characters.
Did you set your database fields to utf-8?
Did you set your database collation to utf8_unicode_ci?
Did you set the database.php config to use utf8_unicode_ci?
Also when creating a new database with phpmyadmin you need to
goto the operations tab and then change the database to use
utf8_unicode_ci
Without seeing any code it is hard to see what is going on!
InsiteFX
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.