Author Topic: Problem with special chars in feed  (Read 1381 times)

escribacafe

  • Newbie
  • Posts: 6
Problem with special chars in feed
« on: July 05, 2012, 01:48:58 pm »
Powerpress, when generate the feed show special characters like á ã é etc with strange symbols that mess the text. The wordpress feed is ok, as you can see that the special chars in the wp feed are showing nice, and the same text generated for itunes by powerpress is messe up.

Feed: http://www.escribacafe.com/feed/

Any ideas?

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: Problem with special chars in feed
« Reply #1 on: July 05, 2012, 05:05:49 pm »
Yes, make sure your setup your database and your wp-config.php for saving your data in UTF8 format. This is typically the result when the database is storing the text in one format and wordpress writes it to the database in another.

escribacafe

  • Newbie
  • Posts: 6
Re: Problem with special chars in feed
« Reply #2 on: July 06, 2012, 02:04:38 pm »
OK, but why only the items generated by powerpress has this problem? all other stuff in the feed looks nice

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: Problem with special chars in feed
« Reply #3 on: July 06, 2012, 02:06:38 pm »
Yes, that is because WordPress doesn't have to change the data in anyway, where-as PowerPress shortens and formats the data for iTunes attributes. So if WordPress settings say UTF but your database is latin, PowerPress will mess up the conversion. Does this make sense why everything has to be in sync?

escribacafe

  • Newbie
  • Posts: 6
Re: Problem with special chars in feed
« Reply #4 on: July 06, 2012, 07:01:09 pm »
I changed my entire database to UTF-8. The problem still exist.

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: Problem with special chars in feed
« Reply #5 on: July 07, 2012, 08:18:34 am »
How did you change it to UTF8? If you just change the database tables from one to the other, that's not going to work. The typical procedure you export the data to an SQL file, run the file through iconv, then re-import the database.

escribacafe

  • Newbie
  • Posts: 6
Re: Problem with special chars in feed
« Reply #6 on: July 09, 2012, 01:59:32 pm »
I used a WP plugin that do this job

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: Problem with special chars in feed
« Reply #7 on: July 09, 2012, 02:06:03 pm »
To confirm if its a powerpress problem or not, write a new post (not one that was converted) and then see if the characters are getting messed up with the new post.

What is the plugin called that you used to conert the database charset and data?

escribacafe

  • Newbie
  • Posts: 6
Re: Problem with special chars in feed
« Reply #8 on: July 09, 2012, 02:36:00 pm »
Posted a new podcast test and the problem persists. The plugin is UTF-8 DB Converter.

One point, in my wp-config.php i dont have that line where it shows the UTF-8 stuff... should be this the problem?
« Last Edit: July 09, 2012, 02:48:21 pm by escribacafe »

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: Problem with special chars in feed
« Reply #9 on: July 09, 2012, 03:00:36 pm »
That can be the source of the problem, you should have the following define.

Code: [Select]
define('DB_CHARSET', 'utf8');
PowerPress and other pluigins use this define to know how to convert the text from your database.

escribacafe

  • Newbie
  • Posts: 6
Re: Problem with special chars in feed
« Reply #10 on: July 10, 2012, 04:49:44 pm »
Problem Solved. Thank you Angelo, for the tips. And now I want to share my suffer to help others suffer too in this painfull proccess:

My WP installation is very old, so the data in DB wasn't stored in UTF8 - even changin this setting in WP options or changing the DB charset.

There is a lot of help articles and tips in internet for doing this. But i dont have root access in my SQL, no SED or other pro stuff... i only have the basic access in phpMyAdmin and im no programmer at all. So, here is the "ignorant" solution:

(backup first)

1- use a plugin in WP to change your database to UTF8 (I used this one: http://wordpress.org/extend/plugins/utf-8-db-converter/)

2- Export/dump your database as the original format (in my case latin1)

3- Open in notepad++ or wrangler for mac and convert to UTF8 (if your DB is very old and messy like mine, you'll need to spent a lot of hours converting special characters by hand). search and change any "latin1" (in my case) command to utf8. save the sql file.

4- drop all your tables and columns of your wp db.

5- use this command in SQL to change your db charset:

Code: [Select]
ALTER DATABASE mydatabasename charset=utf8;
6- import your edited sql.

7 - put this line of code in your wp-config.php (or edit if is already there but different):
Code: [Select]
define('DB_CHARSET', 'utf8');
Dont forget to backup your entire site...A lot of things can go wrong.. I spent 2 entire days in this thing and after a lot of try and error, this was what worked.

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: Problem with special chars in feed
« Reply #11 on: July 10, 2012, 08:08:57 pm »
That is very painful. WordPress.org used to have directions how to do this, a lot of us had to do this around 2008-2009. I seem to recall using tools such as myslqdump and iconv to convert the encoding from the command line.