Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
Hi, I'm having the same problem as the person in this post but there was no resolution to their problem...

viewtopic.php?f=4&t=8350&p=15355&hilit=special+characters#p15355

where my special characters (specifically a pound sign) display as a black diamond with a question mark in.

I created a shortcode to allow my client to enter new paypal buttons anywhere she wants in a richtext area using the following [embed code='PayPal code here']

But entering special characters in a shortcode don't seem to display properly. Entering pount signs in the rest of the richtext work fine.

I've got charset=UTF-8 in the meta tag.

Any suggestions on how to fix this are very welcome. Thanks.
Hi cezz :)

I'm having the same problem as the person in this post but there was no resolution to their problem...
Actually the problem was resolved but it so happened that it was done over PM.

Here is a quote from the private conversation I had explaining the problem -
Thanks for the heads-up on the special-characters appearing in shortcode problem.

It turns out that PHP prior to 5.4 defaulted to ISO-8859 (instead of UTF-8) if the character set is not explicitly specified - which is what was happening.

I've rectified the code in the relevant file and things should work fine now.

I'm attaching the rectified 'HTMLParser.php' file. Please place it in 'couch/parser' folder overwriting the existing version.

Please let me know if this rectifies the problem and I'll commit the change in the core.

So, this problem has been rectified in the Couch v1.4.5RCx but if you don't wish to upgrade to the newer version, please do the following -
Edit 'couch\parser\HTMLParser.php' file and change line no. 127 from this -
Code: Select all
$str = html_entity_decode( $str, ENT_QUOTES );

to the following -
Code: Select all
$str = html_entity_decode( $str, ENT_QUOTES, K_CHARSET );

Hope it helps.
Hi KK,

Thank you very much for this! I've just tried it and it's worked a treat!
You are welcome :)
4 posts Page 1 of 1
cron