VirtueMart Forum

VirtueMart 2 + 3 + 4 => Language/Translations => Topic started by: six gun on July 05, 2018, 06:57:59 AM

Title: Apostrophes
Post by: six gun on July 05, 2018, 06:57:59 AM
i feel sure this must have been dealt with elsewhere on the forum but i cannot find it.
I do not have this problem anywhere else in Joomla.
When i save text with an apostrophe in it, it is saved as [& # 39 ;] i am separating the characters so it does not save in the forum as ' an apostrophe.
i only have this issue in French as i do not use apostrophes otherwise.
i can sort this out by going into the database and replacing the [& # 39 ;] with '
This occurs every time i save text box inputs such as product title, meta key, meta description.

Is there anyway to get round this - as i am editing product entries quite a lot at the moment i feel like i have done this quite a few times.
Title: Re: Apostrophes
Post by: hellorain on July 05, 2018, 07:27:05 AM
Hello,

You have to pass string some  method like addslashes(string). that will sort out.

Best Regards,
hellorain.
Title: Re: Apostrophes
Post by: GJC Web Design on July 05, 2018, 12:40:24 PM
I also hit this problem with the display of products names containing a <br /> - saved as  &#60;br /&#62;

I translated at template level -- e.g.

$name = str_replace('&#60;br /&#62;', '<br />', $product->product_name);
Title: Re: Apostrophes
Post by: jjk on July 05, 2018, 16:14:53 PM
I didn't find the exact cause of the problem yet. It is probably related to a changed filter in revision 9722. In VirtueMart 3.2.15 the issue seems to be solved for the product name, but it still exists for the meta data.

However, if you are typing on a Windows system, you can use one of the following alt codes to enter 'real' quotes/apostrophes as a workaround.
Alt 0145    '    curly single open quote
Alt 0146    '    curly single close quote (The real Apostrophe)
Alt 0147    "    curly double open quote
Alt 0148    "    curly double close quote
Alt 0132    ,,    low curly doublequote

There are more signs which may look like apostrophes, but I tested only the ones mentioned above.
Title: Re: Apostrophes
Post by: six gun on July 08, 2018, 12:28:10 PM
What a star.
i just used the Num Lock -
Press Alt key + 0146 for the ' sign.
Saved this and bingo - it works a treat.

Fantastic advice.