php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77940 test using outdated mon_thousands_sep for Swedish
Submitted: 2019-04-24 22:27 UTC Modified: 2019-04-25 12:21 UTC
From: v-altruo at microsoft dot com Assigned: cmb (profile)
Status: Closed Package: Testing related
PHP Version: 7.2.18RC1 OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: v-altruo at microsoft dot com
New email:
PHP Version: OS:

 

 [2019-04-24 22:27 UTC] v-altruo at microsoft dot com
Description:
------------
Test fails across all builds. 
Test location: ext\standard\tests\strings\bug65769.phpt

I believe the separator for thousands in Swedish are " " which is why the test is failing.

Test script:
---------------
$locale = setlocale(LC_ALL, 'sve');
$lconv = localeconv();
var_dump(
		$locale,
		$lconv['decimal_point'],
		$lconv['thousands_sep'],
		$lconv['int_curr_symbol'],
		$lconv['currency_symbol'],
		$lconv['mon_decimal_point'],
		$lconv['mon_thousands_sep']
	);

Expected result:
----------------
string(19) "Swedish_Sweden.1252"
string(1) ","
string(1) " "
string(3) "SEK"
string(2) "kr"
string(1) ","
string(1) "."

Actual result:
--------------
string(19) "Swedish_Sweden.1252"
string(1) ","
string(1) " "
string(3) "SEK"
string(2) "kr"
string(1) ","
string(1) " "

Patches

77940.patch (last revision 2019-04-25 12:21 UTC by cmb@php.net)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-04-24 23:16 UTC] requinix@php.net
-Summary: localconv mismatch +Summary: test using outdated mon_thousands_sep for Swedish -Status: Open +Status: Verified
 [2019-04-24 23:16 UTC] requinix@php.net
I'm not entirely sure but I think this changed with CLDR 23 around 2013.
https://unicode.org/cldr/charts/22/by_type/patterns.numbers.html#Western_Digits_(latn)
https://unicode.org/cldr/charts/23/by_type/patterns.numbers.html#Western_Digits_(latn)
22 had a <currencyGroup> with lone Swedish as '.' while 23 dropped the category.

Regardless, current chart says the separator should indeed be a space.
https://unicode.org/cldr/charts/latest/verify/numbers/sv.html
 [2019-04-25 06:58 UTC] cmb@php.net
-Assigned To: +Assigned To: cmb
 [2019-04-25 07:00 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=37ca6a7a2a333b5a783b2b8726bb5c9674c6e301
Log: Fix #77940: test using outdated mon_thousands_sep for Swedish
 [2019-04-25 07:00 UTC] cmb@php.net
-Status: Verified +Status: Closed
 [2019-04-25 09:39 UTC] cmb@php.net
-Status: Closed +Status: Re-Opened
 [2019-04-25 09:39 UTC] cmb@php.net
Hmm, the "fix" breaks the AppVeyor builds.  I'll investigate.
 [2019-04-25 10:27 UTC] requinix@php.net
Windows must have changed something recently: my desktop Win10 is not up to date with patches (shame on me) and says mon_thousands_sep is a period, but my laptop Win10 which is up to date says it's a \xA0 non-breaking space.

So I guess AppVeyor's Windows is missing a patch; I didn't see anything in the Win10 update history referencing Swedish specifically, but there have been a few updates to locale information in the last few months.
 [2019-04-25 12:21 UTC] cmb@php.net
The following patch has been added/updated:

Patch Name: 77940.patch
Revision:   1556194871
URL:        https://bugs.php.net/patch-display.php?bug=77940&patch=77940.patch&revision=1556194871
 [2019-04-25 12:21 UTC] cmb@php.net
Whether it's a period or a non-breaking-space indeed depends on
the system, but it also may depend on any user customization.  So
it seems to me that we shouldn't be too picky here and simply
allow both (which would still not cater to customization), i.e. to
apply the attached 77940.patch.
 [2019-04-25 17:42 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=bfbfb9dabd8369ec1891da99027f920bd851caee
Log: Fix #77940: test using outdated mon_thousands_sep for Swedish
 [2019-04-25 17:42 UTC] cmb@php.net
-Status: Re-Opened +Status: Closed
 [2019-04-25 21:30 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=7ddfe73e69bd847c33bd69fb92d2f5f82b89c778
Log: Fix #77940: test using outdated mon_thousands_sep for Swedish
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 18:01:29 2024 UTC