CP module displaying symbols in accents
Good day. This might not be the right place to ask what to do, but I am not entirely sure the problem is with the module.
I am using the latest Canada Post 1.50 contribution (by Dr. byte, I believe) with my Zen Cart. When I ask delivery prices on checkout in french, I get the right rates, but have accents replaced with black "?" symbols (IE: "Colis acéléré" is displayed as "Colis ac?l?r?").
My accents DO display properly all over my site and have set "@setlocale(LC_TIME, 'fr_CA.utf8');" in my CUSTOM french.php file. This problem is happening on both my Zen Cart stores:
www.servicesinfosl.com
www.boutiqueimpasse.com
It is only the results coming back from Canada Post XML that returns what seams to be the wrong coding. Anyone have a solution / workaround and have also encountered the same problem?
Re: Custom module displaying symbols in accents
Are you saving your custom French language files as "UTF8 without BOM"?
Re: Custom module displaying symbols in accents
I think so. The original files were translated in house using the v1.5.0 distribution English source code. I use Crimson Editor to edit php files. Only Canada Post service description does this. I have no issues anywhere else concerning this.
Re: Custom module displaying symbols in accents
I recall a similar issue from awhile back. Does this help? ... http://www.zen-cart.com/showthread.p...052#post620052
Re: Custom module displaying symbols in accents
Thanks for the reply. I just checked and that mod is already in place. :-(
Re: Custom module displaying symbols in accents
I have found the solution! Thanks to DrByte's suggestion, I actually added to the original code:
Code:
$methods = array();
for ($i = 0; $i < sizeof($canadapostQuote); $i ++) {
list ($type, $cost) = each($canadapostQuote[$i]);
$type = html_entity_decode($type);
if ($this->cp_online_handling == true) {
if ($method == '' || $method == $type) {
And added the following:
Code:
$methods = array();
for ($i = 0; $i < sizeof($canadapostQuote); $i ++) {
list ($type, $cost) = each($canadapostQuote[$i]);
$type = utf8_encode(html_entity_decode($type));
if ($this->cp_online_handling == true) {
if ($method == '' || $method == $type) {
This fixes permanently the problem. I guess that Canada Post XML does not return UTF-8 encoded results. This FORCES UTF-8 on the results.
Hope this fix is IMPLEMENTED in the CANADA POST module and helps others cursed with the many accent problems. Thanks DrByte!
Re: Custom module displaying symbols in accents
This thread has been moved out of the Bug Reports area since it's not a bug with Zen Cart itself.