|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60424 String with apostrophe are incorrect with MessageFormatter
Submitted: 2011-12-01 13:37 UTC Modified: -
From: gcharneau at gmail dot com Assigned:
Status: Open Package: I18N and L10N related
PHP Version: 5.3.8 OS: Mac OS X 10.6, Windows 7
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.
Block user comment
Status: Assign to:
Bug Type:
From: gcharneau at gmail dot com
New email:
PHP Version: OS:


 [2011-12-01 13:37 UTC] gcharneau at gmail dot com
The formatting of strings containing apostrophes is wrong.

Test script:
$locale = 'fr_FR';
$args = array(1);
$string = "{0, choice, 0<{0} d'eé|1<{0} d'aà}";
echo msgfmt_format_message($locale, $string, $args);
$string = "{0, choice, 0<{0} d''eé|1<{0} d''aà}";
echo msgfmt_format_message($locale, $string, $args);

Expected result:
1 d'eé

1 d'eé

Actual result:
1 deé|1<1 daà

1 deé


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-09-13 21:26 UTC] sam at rmcreative dot ru
Apostrophes are used as escaping character. If you need it in the final string, use ''.
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Oct 26 02:01:23 2020 UTC