meitar/tumblrize — Issue #20: Presence of &nbsp; in WordPress post messes up Cyrillic characters in Tumblr
Author: eugenedae
Created: 2011-12-26 15:05:51+00:00
State: open

Presence of ` ` in WordPress post, which contains Cyrillic characters, messes up encoding of the corresponding Tumblr post. [See the screenshot](http://www.imagocentre.com/images/91/encoding_50.png).

**The fix** is to add UTF-8 encoding declaration to the `html_entity_decode` functions around lines 122 and 123.

So, before:

```php
$post_title = html_entity_decode($post->post_title);
$post_body = wpautop(str_replace('\"', "", html_entity_decode($post->post_content)));
```
after:

```php
$post_title = html_entity_decode($post->post_title, ENT_QUOTES, 'UTF-8');
$post_body = wpautop(str_replace('\"', "", html_entity_decode($post->post_content, ENT_QUOTES, 'UTF-8')));
```