Go Back   Armenian Knowledge Base > Technical sections > Languages, Compilers, Interpreters

Reply
 
Thread Tools

How write in armenian in MySQL?
Old 29.11.2007, 13:20   #1
Settler
 
vahag_1985's Avatar
 
Join Date: 10 2007
Location: Yerevan
Posts: 258
Rep Power: 4
Default How write in armenian in MySQL?

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?
__________________
Кто никогда не совершал безрассудств, не так мудр, как ему кажется.

Old 29.11.2007, 13:37   #2
Ego coder
 
AvDav's Avatar
 
Join Date: 07 2004
Location: Yerevan, Armenia
Age: 44
Posts: 3,738
Rep Power: 5
Default

How do you check the result after query? If you generate html check out if a proper encoding is chosen too.
__________________
Каждый сам кузнец своего счастья, и несчастья тоже.

Old 29.11.2007, 13:50   #3
Settler
 
vahag_1985's Avatar
 
Join Date: 10 2007
Location: Yerevan
Posts: 258
Rep Power: 4
Default

I haven't forgotten
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">..
__________________
Кто никогда не совершал безрассудств, не так мудр, как ему кажется.

Old 29.11.2007, 14:08   #4
Ego coder
 
AvDav's Avatar
 
Join Date: 07 2004
Location: Yerevan, Armenia
Age: 44
Posts: 3,738
Rep Power: 5
Default

This may help:
MySQL AB :: MySQL 5.0 Reference Manual :: 9.1.8 Unicode Support
__________________
Каждый сам кузнец своего счастья, и несчастья тоже.

Old 29.11.2007, 14:38   #5
Settler
 
vahag_1985's Avatar
 
Join Date: 10 2007
Location: Yerevan
Posts: 258
Rep Power: 4
Default

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 .
__________________
Кто никогда не совершал безрассудств, не так мудр, как ему кажется.

Old 29.11.2007, 15:51   #6
Settler
 
vahag_1985's Avatar
 
Join Date: 10 2007
Location: Yerevan
Posts: 258
Rep Power: 4
Default

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
__________________
Кто никогда не совершал безрассудств, не так мудр, как ему кажется.

Old 30.11.2007, 06:57   #7
Шестой Лесничий
 
Varg's Avatar
 
Join Date: 08 2005
Location: Театр Теней
Age: 44
Posts: 2,657
Rep Power: 4
Default

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....

Old 08.11.2008, 23:47   #8
Testosterone
 
Join Date: 01 2005
Location: Yerevan
Age: 50
Posts: 45
Rep Power: 0
Default

Try to use SYLFEAN fonts typ ewhyle you're trying to write armenian
Reply




Реклама:
реклама
Buy text link .

All times are GMT. The time now is 05:51.
Top

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.