PDA

View Full Version : How write in armenian in MySQL?


vahag_1985
Nov 29, 2007, 13:20
I have a php script which writes and reads form mysql tables.
This is how I create connection with mysql:
$conn = mysql_connect("localhost", 'localhost_001','123456')
or die("bla-bla-bla". mysql_error());
mysql_select_db("db_name");
mysql_query("SET NAMES utf8",$connn);
mysql_query("SET CHARACTER SET utf8",$conn);.
My tables have the following properties
charset: utf8
Collation:utf8_general_ci
When I write in english or in russian everything works perfectly. But when I write a data in armenian it turns into ???????????????. Does someone have any ideas?

AvDav
Nov 29, 2007, 13:37
How do you check the result after query? If you generate html check out if a proper encoding is chosen too.

vahag_1985
Nov 29, 2007, 13:50
I haven't forgotten
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">..:)

AvDav
Nov 29, 2007, 14:08
This may help:
MySQL AB :: MySQL 5.0 Reference Manual :: 9.1.8 Unicode Support (http://dev.mysql.com/doc/refman/5.0/en/charset-unicode.html)

vahag_1985
Nov 29, 2007, 14:38
The fact I am confused about is that everything works perfectly with cyrillic symbols. According to the article there is no difference between armenian and russian because both of them use 2 bytes. It seems as if it is something wrong with just supporting of armenian .

vahag_1985
Nov 29, 2007, 15:51
I have found an "empiric solution":)!!!
After executing this command all problems have been solved.

ALTER DATABASE `hhhh` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci

Varg
Nov 30, 2007, 06:57
actually, I think that you had the 1251 collation set by default, that's why you didn't have any problems with russian.
However, the unicode works perfect with any collation, at least for MSSQL2000, 2005, with .net and java front-end (that's what I have checked)

right now I've got .net 2.0 + mssqp 2005 with 1251 collation, armenian not a problem at all....

Testosterone
Nov 8, 2008, 23:47
Try to use SYLFEAN fonts typ ewhyle you're trying to write armenian