Armenian Knowledge Base  

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

Reply
 
LinkBack Thread Tools
Old 29.11.2007, 13:20   #1
Settler
 
vahag_1985's Avatar
 
Join Date: 10 2007
Location: Yerevan
Posts: 258
Downloads: 0
Uploads: 0
Reputation: 88 | 2
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?
__________________
Кто никогда не совершал безрассудств, не так мудр, как ему кажется.
Reply With Quote
Old 29.11.2007, 13:37   #2
The splendid
 
AvDav's Avatar
 
Join Date: 07 2004
Location: Pure thoughts
Age: 36
Posts: 3,408
Downloads: 22
Uploads: 0
Reputation: 222 | 3
Default

How do you check the result after query? If you generate html check out if a proper encoding is chosen too.
Reply With Quote
Old 29.11.2007, 13:50   #3
Settler
 
vahag_1985's Avatar
 
Join Date: 10 2007
Location: Yerevan
Posts: 258
Downloads: 0
Uploads: 0
Reputation: 88 | 2
Default

I haven't forgotten
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">..
Reply With Quote
Old 29.11.2007, 14:08   #4
The splendid
 
AvDav's Avatar
 
Join Date: 07 2004
Location: Pure thoughts
Age: 36
Posts: 3,408
Downloads: 22
Uploads: 0
Reputation: 222 | 3
Default

This may help:
MySQL AB :: MySQL 5.0 Reference Manual :: 9.1.8 Unicode Support
Reply With Quote
Old 29.11.2007, 14:38   #5
Settler
 
vahag_1985's Avatar
 
Join Date: 10 2007
Location: Yerevan
Posts: 258
Downloads: 0
Uploads: 0
Reputation: 88 | 2
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 .
Reply With Quote
Old 29.11.2007, 15:51   #6
Settler
 
vahag_1985's Avatar
 
Join Date: 10 2007
Location: Yerevan
Posts: 258
Downloads: 0
Uploads: 0
Reputation: 88 | 2
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
Reply With Quote
Old 30.11.2007, 06:57   #7
Шестой Лесничий
 
Varg's Avatar
 
Join Date: 08 2005
Location: Театр Теней
Age: 36
Posts: 2,657
Downloads: 1
Uploads: 0
Reputation: 65 | 3
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....
Reply With Quote
Old 08.11.2008, 23:47   #8
Testosterone
 
Join Date: 01 2005
Location: Yerevan
Age: 42
Posts: 45
Downloads: 2
Uploads: 0
Reputation: 11 | 0
Default

Try to use SYLFEAN fonts typ ewhyle you're trying to write armenian
Reply With Quote
Sponsored Links
Reply

Thread Tools


На правах рекламы:
реклама

All times are GMT. The time now is 01:16.


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