Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Arabic language in my sql show as ?????? why and how to solve

Status
Not open for further replies.

ahm1985

Programmer
Dec 6, 2012
138
0
0
EG
Hi guys are there are any way to display Arabic language in MySQL
the website is the picture as below
what setting i must do to prevent this
all arabic language can read good in website
only this line ?????
 
it all comes down to

1. method of upload of the information
2. the charset of the database table
3. the charset of the connection between the client and the database server.
4. the charset of the page on which you are displaying the data

they must all be capable of handling the charset you want and must all be talking the same charset when they get/push data.

 
If the other menu entries are populated from the database, then I would think jpadie's 1st suggested issue would be most relevant.

Were the entries higher in the UL list entered in the same way that the ????? entry was added?
 
Thank you for reply
In this website there are strange thing or missing point
Database is :
see no 15,16
different in language
Interface PHP
See Difference
same interface code
but different only in language
How to change ???? to الصيانه
i set collision for table is
utf8_general_ci
i set collision for database
utf8_general_ci
for colmun used for arabic is
utf8_general_ci
 
read my post.

you need to make sure that:

1. the form that you upload data from is from a utf8 charset (if you don't, and the charset used is less rich, you will lose information)
2. the table uses ut8 charset (not just collation) (ditto above)
3. the CONNECTION to the database server uses utf8 (ditto above, there will be an implicit conversion)
4. the pages displaying the data uses utf8 (ditto ish. there will be an implicit conversion but this will not be permanent as the data storage is not touched)

 
Thank you for reply
if problem in interface(php) Unicode or connection there are more text shown in same page in website
but correctly show Arabic language why this only not show
the menu and sub menu from Database shown
And how to set charset to utf8
 
I check my web page php i found charset found as following
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
meaning have charset
How to make charset for table
 
every part needs to be utf8. the page, the form, the database table, the database connection etc.

if you are convinced that this is the case, then those fields that are not displaying correctly were inputted using a different mechanism.

for mysql in php you make sure that the connetion is in utf8 like this

Code:
mysql_connect($host, $user, $pass);
mysql_query('SET NAMES "utf8"');
mysql_select_db($db);
 
Thank you for reply
you are true
i changed the code in query above using utf8 as you tell me in previous thread
then go to MySQL and remove strange character then rewrite using Arabic language
and OK working but this is will take too much time to change all and rewrite
Are there are any way to accept strange characters(اتصل بنا) and in same time
accept any new characters Arabic
Example
Before changes (Before add MySQL_query in connection in php) as link below
Database
Arabic field :اتصل بنا(WRONG FORMAT) remove that and write كيف حالك
PHP WEBSITE IT SHOW AS FOLLOWING
???????(misunderstood FORMAT)
After changes(after add mysql_query in connection in php) as link below
Database
Arabic field :اتصل بنا(WRONG FORMAT) remove that and write كيف حالك
PHP WEBSITE IT SHOW AS FOLLWOING
كيف حالك (CORRECT FORMAT)
this is OK after changed and i accepted
Only problem Now to make this will take too much time may be one 15 days
Are there are any modification to change that and in same time accept new charachter
 
This will take too much time because every misunderstood format in MySQL
must removed and changed to correct format Arabic to all Arabic text in website
so that if there are any way to accept this strange character then show as website
as
 
unless you know what character set was used to store and transmit the 'bad' information we cannot advise with any accuracy.

However the likelihood is that you have lost data density in the transliteration from one character set to another. If this is the case then you will not be able to get it back. If both charsets used were 8bit AND no transliteration has occurred then it is possible that you can decode and re-encode without data loss. For example ISO 8859-6 is 8 bit, as is utf8.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top