MySQL Forums
Forum List  »  Full-Text Search

Re: Arabic text in mysql Varchar row
Posted by: Mark Webley
Date: September 12, 2011 06:16PM

Where you see the diamonds, is actually square shapes....in my php echoed page....this submit form on this mysql forum prints the square shapes as symbols.

One thing though before I read this message I did the following:
I commented out:
$dbcon->query("SET NAMES utf8");
$dbcon->query("CHARACTER SET 'utf8'");

and now the db fields 'company' and 'title' show:
في الخط ف في الخط ف

and the text comes out correctly in the page....
though php is not the issue to look at now....but to explain...
I did an insert with utf8_encode and then display on the php page with utf8_decode.
for the 'title' and 'company' fields.

The funny thing is Arabic text now comes out correctly for those fields
but now the other fields like 'description' longtext utf8_general_ci utf8
come out funny but in the db shows: في الخط ف في الخط ف

as you mentioned it really looks like a corrupt table...

it is best I keep this simple now to get to the bottom of this....
as it stands the 'title' field is: varchar(255) collation utf8_unicode_ci and chracter set utf8.

for now select hex() shows:


+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------+-----------------------+
| title | HEX(title) | LENGTH(title) | CHAR_LENGTH(title) |
+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------+-----------------------+
| في الخط ف في الخط ف | C383E284A2C382C281C383E284A2C382C5A020C383CB9CC382C2A7C383E284A2C382E2809EC383CB9CC382C2AEC383CB9CC382C2B720C383E284A2C382C28120C383E284A2C382C281C383E284A2C382C5A020C383CB9CC382C2A7C383E284A2C382E2809EC383CB9CC382C2AEC383CB9CC382C2B720C383E284A2C382C281 | 127 | 61 |
+-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------+-----------------------+


Thanks, I will TRUNCATE TABLE and start over. Or DROP TABLE, CREATE TABLE again and I will see what I can get with the
SELECT HEX()...I will get back to this post with some information...

Options: ReplyQuote


Subject
Views
Written By
Posted
15809
September 05, 2011 04:23PM
3929
September 07, 2011 08:01PM
5203
September 08, 2011 04:45PM
3137
September 09, 2011 06:46PM
4865
September 11, 2011 08:03AM
2939
September 12, 2011 11:30AM
Re: Arabic text in mysql Varchar row
3568
September 12, 2011 06:16PM
2725
September 12, 2011 06:17PM
2896
September 13, 2011 09:44PM
3097
September 17, 2011 05:53AM
2675
September 18, 2011 01:45PM
2714
September 19, 2011 04:10PM
2835
September 20, 2011 08:19PM
3203
September 25, 2011 12:09PM
2754
September 28, 2011 09:53PM
2971
September 29, 2011 02:44PM
3691
September 30, 2011 10:14AM
3577
September 10, 2011 03:07PM
4058
September 11, 2011 08:01AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.