Support Requests item #1234103, was opened at 07/07/05 03:49
Message generated for change (Comment added) made by sf-robot
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=377409&aid=1234103&group_id=23067
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
>Status: Closed
Priority: 5
Submitted By: Creak (mrcreak)
Assigned to: Michal Čihař (nijel)
Summary: UTF-8 characters broken in database
Initial Comment:
I've got all my tables and databases in
utf8-general-ci. Everything works perfectly between my
sites and mysql, but in phphmyadmin, when I browse the
tables, every accents looks like "Â@", which won't
bother me if when i want to edit a line, these
characters were replaced by strange "?" character.
----------------------------------------------------------------------
>Comment By: SourceForge Robot (sf-robot)
Date: 07/25/05 19:00
Message:
Logged In: YES
user_id=1312539
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).
----------------------------------------------------------------------
Comment By: Michal Čihař (nijel)
Date: 07/11/05 12:24
Message:
Logged In: YES
user_id=192186
You can change default character set in MySQL to be
something else (right now I'm not sure whether it isn't
compile time option). Anyway you should set charset your
application uses while starting connection, so the SET
CHARACTER SET solution is correct. When you insert utf8
string as latin1 you get such ugly string as you saw.
Setting this to pending as I hope it has been replied.
----------------------------------------------------------------------
Comment By: Creak (mrcreak)
Date: 07/11/05 12:00
Message:
Logged In: YES
user_id=1090179
I've read the link you gave to me (in fact i even read the
whole 10.3 section)
I've detected there was still a lot of latin1 charset, but
I'm not sure of what to do now (this is where I need your
help :))
Here is a summary of the different character_set and
collation I used to use:
Character set:
server = latin1
database = utf8
connection = latin1
client = latin1
results = latin1
Collation:
server = latin1_swedish_ci
database = utf8_general_ci
connection = latin1_swedish_ci
Indeed there are some kind of mixes between latin1 and
utf8... I better understand why it was a complete mess in pma.
Now I need your help (please :)) so that I can find the good
solution for my problem (and btw, completely understand the
problem). I don't have access to the mysql conf file because
i don't have a dedicated server yet, and of course I don't
have access to the mysql binary. So I've added this into my
script, just after the mysql_select_db call:
mysql_query("SET CHARACTER SET 'utf8'");
It seems to works, now the characters displays as in pma for
the old insertion, but everything works perfectly when I add
them from a form or directly with pma.
Is it the best solution for my problem? (and should I add an
"or die()" after the call or the query always works?)
Thanks a lot for your time about this post
----------------------------------------------------------------------
Comment By: Michal Čihař (nijel)
Date: 07/11/05 10:31
Message:
Logged In: YES
user_id=192186
I mean php script. By default MySQL uses iso-8859-1 for
connection, so you have to change it in php script.
You should read at least this part of MySQL documentation:
http://dev.mysql.com/doc/mysql/en/charset-connection.html
----------------------------------------------------------------------
Comment By: Creak (mrcreak)
Date: 07/11/05 10:25
Message:
Logged In: YES
user_id=1090179
Everything is in utf8-general-ci... the pma language, the
database, the tables and the fields in these tables
When you say that it's my application, you mean that it's
firefox that is making this or my php script? Because
seriously I try to respect as much as I can the W3C standard
(ie doctype and meta tags) and there is only phpmyadmin that
has problem with utf8 pages...
Of course in my pages I don't use utf8_encode/decode since
all the items I manage is in utf8. So there should be no
need to encode/decode them into iso-8859-1 charset...
I don't know what to say more... have you tried it yourself?
making fresh utf8 database and table and creating a php
script that list the table and allows to insert a new row in
it. Then try to insert new row from this page and from
phpmyadmin.
How could it be a bug in my application if it happens only
in phpmyadmin??... maybe its a conf problem, but i don't see
what more i could set to utf8 here...
I really hope we'll solve this problem, because pma without
being able to change the rows, it's quite limited... :-/
----------------------------------------------------------------------
Comment By: Michal Čihař (nijel)
Date: 07/11/05 10:02
Message:
Logged In: YES
user_id=192186
Sorry, this looks to me as bug in your application, moving
to support requests.
What charset do you use in mysql connection there?
----------------------------------------------------------------------
Comment By: Creak (mrcreak)
Date: 07/11/05 09:56
Message:
Logged In: YES
user_id=1090179
I forgot to say that if I force the charset to iso-8859-1 in
my browser, then i see the table list as in phpmyadmin (ie I
see the accent in the first row, but stuff like "ù" in the
others)
----------------------------------------------------------------------
Comment By: Creak (mrcreak)
Date: 07/11/05 09:53
Message:
Logged In: YES
user_id=1090179
I've created a new table in my database in localhost (pma
2.6.2), the charset of my database ans the one of the new
table (fs_test) is utf8-general-ci. I've also created a
brand new php page (very simple) which list the table and
allows to insert data in it too.
The first insert have been made by hand in phpmyadmin
(that's why the accent are printable) and the others are
inserted with a page written in utf8 (the browser detect the
charset as utf8 too). When i list the rows, the first row
display the weird '?' characters while the others are well
displayed...
Here is the dump:
Command:
mysqldump --default-character-set=utf8 -uroot -p foolstep
fs_test
Result:
-- MySQL dump 10.9
--
-- Host: localhost Database: foolstep
-- ------------------------------------------------------
-- Server version 4.1.11-Debian_4-log
/*!40101 SET
@OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET
@OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET
@OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS,
UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS,
FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE,
SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `fs_test`
--
DROP TABLE IF EXISTS `fs_test`;
CREATE TABLE `fs_test` (
`varchar` varchar(255) NOT NULL default '',
`text` text NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Dumping data for table `fs_test`
--
/*!40000 ALTER TABLE `fs_test` DISABLE KEYS */;
LOCK TABLES `fs_test` WRITE;
INSERT INTO `fs_test` VALUES ('héhé','ô ça
gùze!'),('éà ùçéà ùç','éà ùç'),('éïû','µ£^%');
UNLOCK TABLES;
/*!40000 ALTER TABLE `fs_test` ENABLE KEYS */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET
CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
I've also tested the command whithout the
"--default-character-set=utf8" and the diff is exactly the same.
I hope there is a solution...
----------------------------------------------------------------------
Comment By: Michal Čihař (nijel)
Date: 07/11/05 06:04
Message:
Logged In: YES
user_id=192186
And are you sure that data is stored correctly in database?
Can you please post here (or privately to me) utf8 dump of
that table? You can get it using mysqldump:
mysqldump --default-character-set=utf8 -uuser database table
----------------------------------------------------------------------
Comment By: Creak (mrcreak)
Date: 07/10/05 23:26
Message:
Logged In: YES
user_id=1090179
I'm using pma 2.6.1-rc1 and firefox 1.0.4. All these under
Linux.
I've attached a screenshot
----------------------------------------------------------------------
Comment By: Michal Čihař (nijel)
Date: 07/10/05 11:04
Message:
Logged In: YES
user_id=192186
What phpMyAdmin version are you using and what browser?
Moving to bugs.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=377409&aid=1234103&group_id=23067
|