Hi Everyone!

I am having a uge problem, some days ago my webserver harddisk starts to fail, my first action was to migrate every thing as soon as possible... i made a dump of the drupal database that was in the server so i could restore it once the machine was repaired... problems began right here. When i restored the data to the new server all text word that had an acent like (até) got turned in to some like this (atõñ). For sure i forgot to say what locale data had when i dumped the data... I know that Unixes choose their friends very carefully and portuguese language may not be in the top of the list... but it happens.

My question is, how can correct it now?

I have an investigation site for a group of lawers that is completely closed becouse every text wrote got messed up.

Any help would be very apreciated.

Thankyou all in advance.

Edson-SysAdmin.

Comments

killes@www.drop.org’s picture

We need more info. What is the collation used by the database? Which version of Drupal exactly?
--
Drupal services
My Drupal services

Edson-sysAdmin’s picture

First of all thankyou for quick reply,

The information that you requied:

Drupal 4.5.2

About the collation, well... will not lie to you, i was googling a bit to try to give you a correct answer but the fact is that i am not sure what a collation is but i belive that my database is using the default.
Now that you talk about collation i do believe that the problem exatly this. Probabily i made a mistake or the database has a diferente collation from the previous version.

If there anyway that a could do to extract the collation from mysql please let me know also if there is anything else i could give you.

Best regards,

Edson-SysAdmin.

killes@www.drop.org’s picture

First of all you should upgrade to the latest release of Drupal 4.5. The one you use is insecure.

I think you should look at the sql dump and try to see in which encoding it is. Then you can run iconv or recode on the dump to convert it to utf-8. With Drupal 4.5 the collation should not matter.
--
Drupal services
My Drupal services

Edson-sysAdmin’s picture

Well thankyou for the information that the version that i am using is insecure, i'll update ASAP.

I took a quick tour into my sql dump file and i found this..

/*!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' */;

I think that the 4th line means that the file is indeed in uft8 charset... but for portuguese language isn't this correct?

Well i've been googling and tryed this...

       iconv -f LATIN1 -t UTF-8 drupal_mod.sql -o try02.sql

But it did not solve my problem.
I've tryed some other types using iconv -l... but no success

I'll let here a small example of my sql file before and after iconv...

before...

      Cadernos do IJI/índice de Antígona, n.ú I.htm','','72.30.102.89',0,1144209971),('Página não encontrada'

                            ^                  ^              ^                                                          ^           ^

^ bad chars

After...

    Cadernos do IJI/índice de Antígona, n.ú I.htm','','72.30.102.89',0,1144209971),('Página não encontrada'

As you can see it does not solve and even got worse...

Before i end this post i would like to a leave a question... am i able to repair a allready dumped slq file or any effort in this file will not restore the data it contains to it's normal state?

Best Regards,

Edson SysAdmin.

killes@www.drop.org’s picture

I am afraid your sql dump looks very messed up. Maybe you should rather try "search and replace" if the broken chars.
--
Drupal services
My Drupal services

Edson-sysAdmin’s picture

Hi again,

I was afraid that you would say that, i'll try to make a script to search and replace but it will not solve the entire problem.

I would like to say thankyou for your time, i'll have a shell fight today! :D

Best Regards,

Edson SysAdmin.