Hello everyone, after an hour or searching for an answer, I've decided to post this question to the community.
I have installed Drupal 4.6.3 and Mysql 4.1.13 locally on my windows xp laptop.
Everything works, but I'm having a problem that makes me think perhaps I need to convert my database to utf8. The site is in Spanish. When I create content that has accents using the Drupal admin interface , it shows properly on the website, but when I look at the table data using phpmyadmin, the accented characters show up as garbled.
I have also found that when I write php scripts that if I want to, for example, compare a string retrieved from the database that contains an accent to a literal string, the literal string needs to contain the same garbled text i see in phpadmin in order to work. I cut the garbled text as displayed in phpmyadmin and paste it into my php code. e.g. I have to code $value == "Datos Básicos" instead of "Datos Básicos".
I'd really like to be able to see properly rendered text in phpmyadmin, and not have to use garbled string literals in my phpcode. Is this something I just have to live with? In my searching I have come across dicussions stating that the drupal database must use latin1 as a character set, despite the fact that Drupal is working with utf8. Is this true, or would converting the database to utf8 solve my problems?
Thanks for your help.
By the way, in case this sheds any light on the problem, using phpmyadmin, I see I have the following characterset settings (session / global):
Client: utf8 / latin1
Connection: utf8 / latin1
database: latin1 / latin1
results: utf8 / latin1
server: latin1 / latin1
system: utf8 / utf8
And the following collation settings (session /global)
connection: utf8_general_ci / latin1_swedish_ci
database: latin1_swedish_ci / latin1_swedish_ci
server: latin1_swedish_ci / latin1_swedish_ci
Comments
I have the same problem
Sorry for my English. I'm Czech and my language use special characters (diacritics). I install Drupal 4.6.3 on my hosting with PHP 5 and MySQL 4.15. I notice that extended chars in database is replaced.
For example:
é -> é
ó -> ó
I find problem in connect to database.
I fix this when I add this line to database.mysql.inc file in includes directory.
$result2 = mysql_query("SET NAMES 'utf8'");
Add after this line:
$result = mysql_query($query, $active_db);
Could I just create drupal database as UTF8?
Thanks a lot for your suggestion. A couple additional questions:
1. Would creating the database with character set UTF8 also solve the problem?
2. If I use your solution, do I need to perform a character set conversion on the data that is already in the database BEFORE altering database.mysql.inc?
Thanks for your help!
Steve
Revista Y AHORA QUÉ | Selectividad - Universidades - Foro Blog Chat Estudiantes
Thats problem
I try create database with utf8 charset but problem not solved.
I think, you must convert data that you insert before edit database.mysql.inc
My solution is only what I find when I try solved my problem.
I recommend test it before use it.
děkuji ! I applied this in
děkuji !
I applied this in drupal 4.7.3 & it fixed the problem there.
- will