php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70574 Tests fail due to relying on Linux fallback behavior for gettext()
Submitted: 2015-09-24 16:34 UTC Modified: -
From: rainer dot jung at kippdata dot de Assigned:
Status: Open Package: Gettext related
PHP Version: 7.0.0RC3 OS: Solaris
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: rainer dot jung at kippdata dot de
New email:
PHP Version: OS:

 

 [2015-09-24 16:34 UTC] rainer dot jung at kippdata dot de
Description:
------------
The following six gettext tests fail on Solaris:

- ext/gettext/tests/gettext_basic-enus.phpt
- ext/gettext/tests/gettext_bindtextdomain-cwd.phpt
- ext/gettext/tests/gettext_dcgettext.phpt
- ext/gettext/tests/gettext_dgettext.phpt
- ext/gettext/tests/gettext_dngettext-plural.phpt
- ext/gettext/tests/gettext_ngettext.phpt

They fail, because they set locale to en_US.UTF-8, but the message catalog used in the tests is located in ext/gettext/tests/locale/en.

On Linux, gettext() has a fallback behavior. If it can't find the message for a certain locale, it will try other similar locals. So after looking for en_US.UTF-8, it checks en_US and finally en. But this behavior is a non-standard extension. On Solaris, gettext() will not fall back from en_US.UTF-8 to en.

The problem can be fixed for any platform, by moving the directory with the test message catalog to the correct place:

- move ext/gettext/tests/locale/en to ext/gettext/tests/locale/en_US.UTF-8
- move ext/gettext/tests/locale/fi to ext/gettext/tests/locale/fi_FI



Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Wed Jul 24 03:01:26 2019 UTC