DannyPhantom Posted November 4, 2016 Posted November 4, 2016 Hey there, I have big thoruble with my currency and ipb4 on windows server, I don't know If I have the right php.ini settings. can someone help me? This would be great. Date and Time will work but the currency don't work. At the shop I only see a sign with "?" when I setup it to EUR and under languages to : de-de / German_Germany.1252 / deu Dan
DannyPhantom Posted November 4, 2016 Author Posted November 4, 2016 With this I get the right currency: <?php $formatter = new NumberFormatter('de_DE', NumberFormatter::CURRENCY); echo $formatter->formatCurrency(-0.99, 'EUR'), PHP_EOL; $formatter = new NumberFormatter('en_CA', NumberFormatter::CURRENCY); echo $formatter->formatCurrency(-0.99, 'USD'), PHP_EOL; ?> I don't understand it, IPB show up me this and remove the price from store:
DannyPhantom Posted November 4, 2016 Author Posted November 4, 2016 I have solved this. For using the right currency sign (Euro) on Windows I had to change a line at the lang.php Replace this: $this->locale = localeconv(); with that here: $locale_info_from_windows = localeconv(); $locale_info_from_windows['currency_symbol'] = iconv('Windows-1252', 'UTF-8', $locale_info_from_windows['currency_symbol']); $this->locale = $locale_info_from_windows; Best Regards,
Luuuk Posted August 13, 2018 Posted August 13, 2018 The solution above works in other cases/locales too. I had a similar problem, but with a number separator for Polish language: The issue was fixed using the following code: $locale_info_from_windows = localeconv(); $locale_info_from_windows['thousands_sep'] = iconv('Windows-1252', 'UTF-8', $locale_info_from_windows['thousands_sep']); $this->locale = $locale_info_from_windows; List of supported values is listed here: localeconv.
bfarber Posted August 13, 2018 Posted August 13, 2018 This should already be happening (the convertString() method in Lang.php, though it uses CP1252 instead of windows-1252. You may wish to submit a ticket so we can look into why it isn't working for you.
Luuuk Posted August 13, 2018 Posted August 13, 2018 29 minutes ago, bfarber said: This should already be happening (the convertString() method in Lang.php, though it uses CP1252 instead of windows-1252. You may wish to submit a ticket so we can look into why it isn't working for you. Just to confirm, does it make any sense that I will submit a ticket again? I already did, reporting the issue among other things and I was misdiagnosed ("your utf8 conversion didn't process properly ") and told that a support for Windows environment is limited and I should move to a Linux environment for further diagnosis (!).
bfarber Posted August 13, 2018 Posted August 13, 2018 It is true that support for Windows environments is limited, yes. Frankly it's fairly non-standard (and indeed, this particular issue would not be present on Linux because Linux supports UTF-8 encoded locales while Windows does not).
Recommended Posts
Archived
This topic is now archived and is closed to further replies.