Page 1 of 1

some utf-8 characters not displayed correctly after db import

Posted: Sun Jun 17, 2007 2:18 am
by nixonie
everything was OK originally with the site but some utf-8 characters are not displayed correctly after complete db import (MySQL - 4.1.11, joomla 1.0.12) which i had to do from the backup because db was deleted due to a human error (unfortunately, it happend :( )
    * language is macedonian
    * browser selects utf-8
    * problematic characters are in content
    * in page source: content="text/html; charset=utf-8"
    * in the language file - utf-8 is defined for '_ISO'
i used phpmyadmin for dump and import, collation is utf8_general_ci, dump is also utf8 without BOM characters (checked in notepad++), there is a CHARSET=utf8 for every table in database dump

some of the characters (only 3 specific characters to be concrete) are displayed as ??

can anyone please help, i really have no other idea, tried everything i could think of.  :(

Re: some utf-8 characters not displayed correctly after db import

Posted: Sun Jun 17, 2007 5:11 am
by infograf768
Do these characters display OK when you look at these contents in PHPMyAdmin?
Could you post an url?

Re: some utf-8 characters not displayed correctly after db import

Posted: Sun Jun 17, 2007 5:50 pm
by nixonie
Hi, thanks for responding, none of the characters display correctly when i view the database contents via phpmyadmin
at the moment the site i have the problem with is offline.

Re: some utf-8 characters not displayed correctly after db import

Posted: Wed Jun 20, 2007 10:22 pm
by Kampp
I have a similar problem. When I look at my export and import in PhpMyAdmin is displays correctly, but when viewing the site it replaces å, æ, ø with squares or nothing.
I have build well over 20 Joomla sites and this is the first time it has happend. Also I have used the same webhotel for several projects. I even tried another webhotel with the same result.

What could be wrong?

Re: some utf-8 characters not displayed correctly after db import

Posted: Wed Jun 20, 2007 10:49 pm
by 092098jvm
I had the same problem with quotes and copyright symbols. For some reason PHPMyAdmin doesn't import symbols properly. They were fine in the original database and in the sql file. I ended up using JoomlaPack to back up the entire site and restore it to another folder and database - worked like a charm!

http://extensions.joomla.org/component/ ... Itemid,35/

Re: some utf-8 characters not displayed correctly after db import

Posted: Wed Jun 20, 2007 10:52 pm
by Kampp
It has to be another problem, why would this only happen now after so many many Joomla sites build?

Re: some utf-8 characters not displayed correctly after db import

Posted: Wed Jun 20, 2007 11:21 pm
by 092098jvm
Got me. From various forum threads I get the sense that not a lot of people are cloning their sites. Maybe it doesn't show up if you restore to the same database? I haven't needed to do that yet.

Re: some utf-8 characters not displayed correctly after db import

Posted: Wed Jun 20, 2007 11:27 pm
by Kampp
What I do is basically create an export in one phpmyadmin and import ind the other one. Is has worked through out 3 years now on so many sites. I just don't see what could have changed...  :'(

Re: some utf-8 characters not displayed correctly after db import

Posted: Thu Jun 21, 2007 7:06 am
by nixonie
I did not solve the problem - i simply made search and replace for problematic characters... i had to do something...
It seems that there are at least a couple of issues that can lead to this kind of problem since this looks very complicated.
I guess i should read more manuals :)

Re: some utf-8 characters not displayed correctly after db import

Posted: Thu Jun 21, 2007 5:47 pm
by 092098jvm
I'm starting to notice more and more problematic characters (diamond question marks, odd charcters, etc.) on a number of Joomla sites, even Joomla developer sites. Could be that I'm just more aware of it now that I'm having to fix it on my site. I've tried setting my browser character encoding to both UTF-8 and ISO-8859-1 and neither seems to display them properly. It seems to a corrupt data in the database.

Re: some utf-8 characters not displayed correctly after db import

Posted: Thu Jun 21, 2007 5:53 pm
by Kampp
I just solved my problem by removing a .htaccess file that was in the root (Joomla site was in a folder).

The odd thing was the the .htaccess file contained the following:

Code: Select all

AddDefaultCharset UTF-8
php_value default_charset "UTF-8"
In other words this would normally be something you set to solve the problem. It must somehow interact with the database charset.

Re: some utf-8 characters not displayed correctly after db import

Posted: Thu Jun 21, 2007 6:00 pm
by 092098jvm
Interesting. My sites are in subfolders as well. I'll try that and see what happens. Thanks!

Re: some utf-8 characters not displayed correctly after db impor

Posted: Wed Dec 10, 2008 11:54 am
by obotor
After more than a year of inactivity on this topic I am going to revive it...
The .htaccess deletion solution is not always acceptable. Incidentally it would not work for some cases where there is no .htaccess...
I figured out the problem may be caused by phpMyAdmin (and its probable interaction with the charset setting of your browser). I advise using the regular command-line prose instead:

Code: Select all

mysqldump -r output_file_path -u user_name -p database_name
This solution solved a case summarised as:
- everything running under linux with UTF-8 locale support
- database export through phpmyadmin with DEFAULT CHARSET UTF8 (firefox2 browser)
- database dump deployment on a secondary fail-over server (database created with DEFAULT CHARSET UTF8)
- characters (from database) not displaying correctly on the website but ok in mysql command-line client.
Obotor
http://www.beorn-technologies.com