|  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
10 + 28 = ?
Subscribe to this entry?

 [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-2021 The PHP Group
All rights reserved.
Last updated: Fri Mar 05 20:01:24 2021 UTC