Open ShaiMagal opened 1 year ago
Hello @ShaiMagal
Could you take a look at this PR and see if it helps to unify the behavior?
Hello @ShaiMagal
Could you take a look at this PR and see if it helps to unify the behavior?
Hi, @kpodemski PS 8.x has another code for function "replaceAccentedChars".
This PR 26160 is for PS 1.7, there is different function "replaceAccentedChars" than PS 8.x
PS 8.x code looks like (different from PR provided, it's PR for PS 1.7, not 8.x):
public static function replaceAccentedChars($str)
{
static $transliterator;
if (!$transliterator) {
$transliterator = Transliterator::create('Any-Latin; Latin-ASCII');
}
return $transliterator->transliterate($str);
}
Hi,
I have a problem with this new function on PS 8.x. Some special characters are no longer removed from the "link_rewrite" property.
$transliterator = Transliterator::create('Any-Latin; Latin-ASCII');
echo $transliterator->transliterate("Copyright ®");
// return => "Copyright (R)"
And so my URL looks like this: mysite.com/category/123456-copyrightR.html
With the letter R in capital.
On PS 7.x, it was mysite.com/category/123456-copyright.html
@ShaiMagal @kpodemski Did you find a solution ?
@valentin-anamorphik Unfortunately I am not familiar with this... So I opened only this issue, not PR... :/ I don't know how to fix correctly without BC. Both functions from PHP and JS should give same results...
Btw, I think, this is minor problem. There is more than 2000 issues opened, so very complicated with this numbers to prioritize this issue...
Prerequisites
Describe the bug and add attachments
Name of product "hülle". If you use BO admin function str2url (regenerate SEO url), this give you result "huelle".
Now try PHP:
Tools::str2url("hülle")
- this give you result "hulle"So, another results from PHP / JS function.
in documentation is written "If the mbstring library is available, the output is the same as the js function of the same name.", but mbstring is enabled.
Expected behavior
PHP function must give same results like JS function.
Steps to reproduce
1) create product with name "hülle" 2) you will get seo url like "huelle" 3) now try get seo url with PHP function:
Tools::str2url("hülle")
4) you will get another result "hulle"PrestaShop version(s) where the bug happened
8.0.3
PHP version(s) where the bug happened
8.1
If your bug is related to a module, specify its name and its version
No response
Your company or customer's name goes here (if applicable).
No response