News:

Support the VirtueMart project and become a member

Main Menu

Problem with ' changed into ' in titles

Started by Rikard, May 31, 2018, 07:51:41 AM

Previous topic - Next topic

Rikard

Hi
I've got a site with four languages, english is the default language. When I add product titles such as "It's a Happy Cake" and save in english everything looks fine. Then when I switch to another language the ' is replaced with '. So far so good, problem is that it's not shown as ' in the frontend, it is shown as '. This can of course be the template, or joomla or whatever. But, there is something strange in VM as well, because everytime I open the product, another ' is added to the title. The front end reads "It's a Happy Cake". Please note the absent & from the second instance. This is true for all duplicates that are added by entering the product over and over.

I have tested with a few more special characters and the same is true for " (inch) but I didn't find this behaviour for any other special characters.

My system
-----
Virtuemart: 3.2.14
Joomla: 3.8.8
php: 7.1.17-1+ubuntu16.04.1+deb.sury.org+1
-----

Best regards,
Rikard

Milbo

That is indeed a very interesting observation. I have no real answer now. Must have something todo with the language locale of php.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

StefanSTS

#2
I can confirm this behaviour for ' and " in VM 3.2.14.

If the backend language is EN, the english product name is saved with the ' or ". The product name in the other language is saved with an escape character.
Product 'something
After another save it becomes:
Product 'something

If you switch the backend language the problem occurs vice versa.
Means the product name is always saved normally (without escape characters) in the used backend language.

--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts

Please use only stable versions with even numbers for your live shop! Use Alpha versions only if you know what risk you are taking.

Milbo

Hmm, means that we need to set the language locale extra. the language locale tells php how to interprete. I am not sure about that, but could be an explanation.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/