AKB Forums

Go Back   AKB Forums > Technical sections > Languages, Compilers and Interpreters
Home Register Blogs FAQ Members List Calendar Downloads Arcade Mark Forums Read

Languages, Compilers and Interpreters C,C++,C#,.NET,Java,PHP,Perl,SQL and more

Troubles when posting message? Click here! :: Проблемы с отправлением сообщения? Нажмите сюда!

Reply
 
LinkBack Thread Tools Display Modes
Old Nov 29, 2007, 12:20   #1
Settler
 
vahag_1985's Avatar
 
Join Date: Oct 2007
Location: Yerevan
Posts: 272
Blog Entries: 1
Rep Power: 1
Reputation: 96
Send a message via ICQ to vahag_1985 Send a message via Skype™ to vahag_1985
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?
__________________
Кто никогда не совершал безрассудств, не так мудр, как ему кажется.
vahag_1985 is offline   Reply With Quote Quote selected
Old Nov 29, 2007, 12:37   #2
Дикообраз-безобраз
 
AvDav's Avatar
 
Join Date: Jul 2004
Location: У самого синего моря
Posts: 2,606
Rep Power: 5
Reputation: 82
Send a message via ICQ to AvDav
How do you check the result after query? If you generate html check out if a proper encoding is chosen too.
__________________
Deutschland, Deutschland über alles
Über alles in der Welt,

Wenn es stets zu Schutz und Trutze
Brüderlich zusammenhält,

Von der Maas bis an die Memel,
Von der Etsch bis an den Belt.

AvDav is offline   Reply With Quote Quote selected
Old Nov 29, 2007, 12:50   #3
Settler
 
vahag_1985's Avatar
 
Join Date: Oct 2007
Location: Yerevan
Posts: 272
Blog Entries: 1
Rep Power: 1
Reputation: 96
Send a message via ICQ to vahag_1985 Send a message via Skype™ to vahag_1985
I haven't forgotten
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">..
__________________
Кто никогда не совершал безрассудств, не так мудр, как ему кажется.
vahag_1985 is offline   Reply With Quote Quote selected
Old Nov 29, 2007, 13:08   #4
Дикообраз-безобраз
 
AvDav's Avatar
 
Join Date: Jul 2004
Location: У самого синего моря
Posts: 2,606
Rep Power: 5
Reputation: 82
Send a message via ICQ to AvDav
This may help:
MySQL AB :: MySQL 5.0 Reference Manual :: 9.1.8 Unicode Support
__________________
Deutschland, Deutschland über alles
Über alles in der Welt,

Wenn es stets zu Schutz und Trutze
Brüderlich zusammenhält,

Von der Maas bis an die Memel,
Von der Etsch bis an den Belt.

AvDav is offline   Reply With Quote Quote selected
Old Nov 29, 2007, 13:38   #5
Settler
 
vahag_1985's Avatar
 
Join Date: Oct 2007
Location: Yerevan
Posts: 272
Blog Entries: 1
Rep Power: 1
Reputation: 96
Send a message via ICQ to vahag_1985 Send a message via Skype™ to vahag_1985
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 is offline   Reply With Quote Quote selected
Old Nov 29, 2007, 14:51   #6
Settler
 
vahag_1985's Avatar
 
Join Date: Oct 2007
Location: Yerevan
Posts: 272
Blog Entries: 1
Rep Power: 1
Reputation: 96
Send a message via ICQ to vahag_1985 Send a message via Skype™ to vahag_1985
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
__________________
Кто никогда не совершал безрассудств, не так мудр, как ему кажется.
vahag_1985 is offline   Reply With Quote Quote selected
Old Nov 30, 2007, 05:57   #7
Шестой Лесничий
 
Varg's Avatar
 
Join Date: Aug 2005
Location: Театр Теней
Posts: 2,657
Rep Power: 3
Reputation: 75
Send a message via ICQ to Varg
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....
__________________
Varg is offline   Reply With Quote Quote selected
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Journey to Artsakh by Abba Seraphim and Father Simon Smyth HOB History and Politics 2 Oct 18, 2007 02:21
Azerbaijan: Famous Medieval Cemetery Vanishes JUJU News 2 Apr 20, 2006 07:11
Armenian International House is looking for country PR manager. Lite Jobs 0 Nov 20, 2005 10:18
There's no genocide in war but losers and winners OTTOMAN History and Politics 10 May 7, 2005 15:07
Recognition neMarina News 1 Apr 18, 2005 09:20


All times are GMT. The time now is 09:57.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
This board was founded on September 29, 2001
Powered by Viper Internet

Affordable Web Hosting | ParevNet

Buy text link