views:

114

answers:

2

Hi Folks.

I'm just having this trouble with Wordpress: I use to have a Blog with and older version of it and of MySQL, and when I export the SQL DB Creation Scripts, they exported with the latin1_swedish_ci Collation.

Know I'm trying to rebuild the blog but it shows a lot of strange characters like:

Imaginaré Creativitá

When It must show: Imaginary Creativity.

I'm on a mac and using TextMate. I try to convert the SQL Script from batch by using:

iconv -f latin1_swedish_ci -t utf8 script.sql > newscript.utf8.sql

But it tells me that:

iconv: conversion from latin1_swedish_ci unsupported

So, What else can I do in order to convert the file? Or can I program a routine with any script language?

Thanks for the answers.

+1  A: 

I had a similar problem a couple of weeks ago and this plugin saved me: http://wordpress.org/extend/plugins/utf-8-database-converter/

Run this before exporting the database and you should be ok.

PS: of course, backup everything before using the plugin!

Vinicius Pinto
Hi Vinicius and thanks for the answer.. the problem is I already exported the db script.
Sheldon
Are you using the --default-character-set=latin1 when importing in MySQL?
Vinicius Pinto
Nop.. It was that, thanks :D
Sheldon
A: 

If your blog was created before WordPress 2.2 then you should not be using DB_CHARSET and DB_COLLATE in your wp-config.php file.

See Editing wp-config.php for more information.

Michael