php.net |  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
Have you experienced this issue?
Rate the importance of this bug to you:

 [2011-12-01 13:37 UTC] gcharneau at gmail dot com
Description:
------------
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é


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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-2018 The PHP Group
All rights reserved.
Last updated: Wed Nov 14 18:01:25 2018 UTC