You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
The software is corrupting symbols like the "°" when used in the Display Name / Meta Titles fields. If we enter as ° using the management interface, the software correctly converts this to a ° when saved. If you then go back in to Update the product, once saved the ° becomes a ?. It is annoying and easy to forget you need to reenter the ° as "°". So far as I can see, the ? only appears in the mini search results. The product page still correctly displays ° so would this be a java error? How to fix?
Last edited by sdn (11-01-2018 10:13:22)
Offline
I believe this is an encoding issue. You may need to add ° to the encoding function - xhtml_translate() - in {private}/core/CORE/CORE.php. That should be part of the translation table already, but your PHP configuration may not have that entry.
Offline
I tried adding to CORE.PHP just under the line $trans['®'] = '®'; (I have deliberately omitted the";" in this post to stop the entities being converted into the symbol when submitted)
$trans['°'] = '°';
I also tried ° and °
All made the situation worse in that after saving a product with &#deg; or ° or ° or ° in the title the minisearch result is always displays ? instead of °. This is a very commonly used symbol so why does it not work?
Last edited by sdn (11-07-2018 02:33:47)
Offline
I assume you're fully updated to version 9.0.2. Please make sure you have this in your .htaccess file:
AddDefaultCharset Off
Also, make sure the encoding on all the K9 database tables is latin1 (FYI: With release 9.0.2 all tables are encoded latin1, but if you updated to 9.0.2 you may have UTF8 tables - depending on how PHP is configured on your server).
Beyond that, I'd recommend changing the following line in CORE::xhtml_translate():
$find = '&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)';
To:
$find = '&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,4};)';
We recently found that change is needed to handle four digit encoded values, which are becoming more common these days. That will be part of the 9.0.3 update.
Offline
I made the changes recommended and retried the experiments detailed above but still the same problem as before.
Offline
You probably tried adding this, but please confirm:
$trans['°'] = 'XXXXXXX';
Where 'XXXXXXX' is '& # 1 7 6 ;' without spaces (forum will echo degree symbol if I type it right). Did you try that one?
Offline
Yes, and "° ;" and "° ;" (without the space).
Last edited by sdn (11-13-2018 11:19:48)
Offline
I know you are understandably sick of this topic but we still get the character corruption despite the changes you made.
Researching a different server issue, I bumped into the page at https://www.interserver.net/tips/kb/wha … o-enable/. Did we try using mbstring? It is not installed on cPanel server by default. Is it the missing link that stopped your attempts from working?
Last edited by sdn (07-15-2019 15:08:15)
Offline
The software only uses mbstring() via a couple of PEAR modules (seding multibyte mail messages, caching JSON results). I'd like you to verify that the changes to CORE.php and the htaccess file addition in post #4 above are part of your install (9.0.3). If so, can you run a phpinfo() script and see what encoding is being used? Also verify the encoding on your database tables?
Offline
I picked the wrong topic as I was really asking about the corruption to customer address details but now we are here...
For some reason mbstring was not in our php71 install so I added it yesterday. The "°" symbol used in prod descriptions has been working fine even though it was not listed in core.php but htaccess was correct. I also added this to core.php:
$trans['±'] = ' 7 7;';
Offline
I think we are good on this now thanks.
Offline