Character encoding issue in lightbox image caption

Posted in: Newspaper
Post count: 82

Hi guys!

First of all, Newspaper is a great theme, I’m setting it up and loving it.

I have run into an issue, however, and while I’m not sure whether it’s up to WP or the theme, I thought you might have a look at it. Character encoding in image captions, when brought up in lightbox, is broken. I enter them via media gallery interface and everything looks fine there. Caption below the image is also fine. But when clicked and the lightbox (modal) pops up, the encoding is all broken. It’s definitely not a font issue, as the characters are messed up in the source code as well. I Googled it around, but it seems to be related to the lightbox plugin, not WordPress itself.

Here’s an example: http://s26.postimg.org/6ahz4gq15/caption.jpg

What would be the easiest way to fix this?

Post count: 82

Additional: This only happens with featured images!

Post count: 1291

Hi,

What theme version do you use? Please provide the text used so i can test it on my side, you could use pastebin – http://pastebin.com/ (just paste the text in there, hit submit and send me the link)

Thank you, Emil G.

Post count: 82

WordPress 4.1, theme version 4.6.1.

The text in question could really be anything with č, ć, š, ž or đ, but in the example above it’s http://pastebin.com/mWa3n53w

Once again, it’s fine everywhere except for the lightbox captions of featured images.

Post count: 1291

Hi,

I’ve tested it on my side and it seems fine – http://screencast.com/t/3Y4qBMnO8dmhttp://screencast.com/t/XXjnwRJtkGp
Please send an email at contact@tagdiv.com , paste a link to this conversation and provide wp-admin access so i can take a look.

Thank you, Emil G.

Post count: 82

I did so, thanks.

I’m wondering whether it could have anything to do with the fact that I’m running a localized (Croatian) version of WordPress.

Post count: 4

Hi,

I have the same problem.
I dont know what files need to encoding to UTF-8?
Any idea?

Thanks

Post count: 82

Hey berger, I’m trying to pin this down to something. Do you use a localized version of WP or the default (English) installation?

Post count: 4

Hy menneskedyr,

localized, hungarian version.
I think the problem is not so difficult. Only the right files need to encoding to UTF-8.
But I dont know where can I found the files of lightbox.

  • This reply was modified 11 years by berger.
Post count: 6600

Hi,

You can find the function for the modal view here: http://screencast.com/t/Rkmc1okrbBGn

Thanks

Post count: 82

Emil found the solution (thanks!):

  1. open file includes/modules/module_modifier/td_module_blog.php
  2. go to line 223

Find the htmlentities function. Now you can either remove it, like this:

http://pastebin.com/AmgLe1Ks

or append the UTF-8 parameter to it:

http://pastebin.com/UbrnzaeT

Works perfectly!

This should not be an issue with PHP 5.4 or 5.5, as they use UTF-8 by default. Earlier versions of PHP use ISO 8859-1 and hence the problem. You learn something new every day!

Post count: 4

Thank you all!!!! 😀

Viewing 12 posts - 1 through 12 (of 12 total)
The forum ‘Newspaper’ is closed to new topics and replies.