Sheldon
Sheldon

Reputation: 2628

Wordpress and MySQL Collations

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.

Upvotes: 0

Views: 594

Answers (2)

Michael
Michael

Reputation: 507

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.

Upvotes: 0

Vinicius Braz Pinto
Vinicius Braz Pinto

Reputation: 8289

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!

Upvotes: 1

Related Questions