Jump to content

Capital Cyrillic Р As Last Letter Of A Word, Not Displayed Correctly


Recommended Posts

Hello,

I have Prestashop 1.4.9.0

Anywhere in a product if the last letter of the text is Р (capital cyrillic letter Р) the text is not diplayed correctly.

I found out the problem to be related to iconv and regexp , but do not know where is the function which processes the text and breaks them

 

Here is the description :

 

 

I have used iconv to convert from cp1251 into UTF-8. I spent a day to investigate why a string with Russian capital 'Р' (sounds similar to 'r') at the end cannot be inserted into a database.

 

The problem is not in iconv. But 'Р' in cp1251 is chr(208) and 'Р' in UTF-8 is chr(208).chr(106). chr(106) is one of the space symbol which match '\s' in regex. So, it can be taken by a greedy '+' or '*' operator. In that case, you loose 'Р' in your string.

 

For example, 'ГР ' (Russian, UTF-8). Function preg_match. Regex is '(.+?)[\s]*'. Then '(.+?)' matches 'Г'.chr(208) and '[\s]*' matches chr(106).' '.

 

Although, it is not a bug of iconv, but it looks like it very much. That's why I put this comment here.

 

 

Does anyone knows how to fix this or which function processes the product texts ?

Link to comment
Share on other sites

×
×
  • Create New...