Islam-Universe

An Introduction To Islam For Non Muslims
It is currently Thu Jul 27, 2017 2:51 pm

All times are UTC - 5 hours [ DST ]




Forum locked This topic is locked, you cannot edit posts or make further replies  [ 1 post ] 
Author Message
 Post subject: mysql with arabic text
PostPosted: Wed Apr 04, 2007 11:11 am 
Arabic text could be used with mysql 4.1.* and up, first the database and
each table field should have utf8 encoding.

ALTER DATABASE `database_name` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin

To create new tables with utf8 encoding use:

CREATE TABLE `test` (
`a` VARCHAR( 10 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL ,
) ENGINE = MYISAM ;

To alter existing tables use:

ALTER TABLE `test` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin

If you are using Perl to retrieve Arabic text then you should issue the
following sql statement:
$dbh->do("SET CHARACTER SET 'cp1256'");

Instead of using print header(),use:
print "Content-type: text/html; charset=windows-1256\n\n";

cp1256 is for Arabic language other languages have different encoding.


Report this post
 
  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2002, 2006 phpBB Group
[ Time : 0.056s | 15 Queries | GZIP : Off ]