Support Forums - Classified Ads Script Osclass
Osclass plugin support => Attributes Plugins => Topic started by: megacheb on May 27, 2019, 12:01:39 PM
-
Hello. I have some problem with encoding with first select - see pictures http://prntscr.com/ntukqo http://prntscr.com/ntuog6
Problem someweare in string
$html .= '<option value="">' . ($name <> '' ? sprintf(__('[b]Select %s ...[/b]', 'attributes'), strtolower($name)) : __('Select value ...', 'attributes')) . '</option>';
Variable %s return wrong encoding. All other function work property with cyrillic.
Database and php has coding UTF-8
Any idea?
-
@megacheb
Replace
sprintf(__('[b]Select %s ...[/b]', 'attributes'), strtolower($name))
with
__('Select', 'attributes') . ' ' . strtolower($name)
I do not think those attributes are original in plugin and yet never heard about such issue.
-
Thanks for you reply. Original: sprintf(__('Select %s ...', 'attributes') without
[b][/b]
When i use without %s i have lost attribute name in first select.
http://prntscr.com/ntuw9x
-
Read precisely.
@megacheb
Replace
sprintf(__('[b]Select %s ...[/b]', 'attributes'), strtolower($name))
with
__('Select', 'attributes') . ' ' . strtolower($name)
I do not think those attributes are original in plugin and yet never heard about such issue.
-
I found solution:
strtolower() does not work for for cyrillic chars. Proof: https://php.net/manual/en/function.strtolower.php
For cyrillic is necessary use mb_strtolower() or mb_convert_case
You, as a developer must know this and use universal solution, which work with various encoding!
Regards