Bug #60424 [Opn->Nab]: String with apostrophe are incorrect with MessageFormatter

From: Date: Tue, 13 Jul 2021 16:51:07 +0000
Subject: Bug #60424 [Opn->Nab]: String with apostrophe are incorrect with MessageFormatter
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-235010@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=60424&edit=1 ID: 60424 Updated by: cmb@php.net Reported by: gcharneau at gmail dot com Summary: String with apostrophe are incorrect with MessageFormatter -Status: Open +Status: Not a bug Type: Bug Package: I18N and L10N related Operating System: Mac OS X 10.6, Windows 7 PHP Version: 5.3.8 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: > Apostrophes are used as escaping character. If you need it in > the final string, use ''. Right[1]. Note though that using choice is discouraged by ICU, and that this particular syntax won't work with recent ICU versions all, but that is another story. [1] <https://unicode-org.github.io/icu/userguide/format_parse/messages/#quotingescaping> Previous Comments: ------------------------------------------------------------------------ [2015-09-13 21:26:52] sam at rmcreative dot ru Apostrophes are used as escaping character. If you need it in the final string, use ''. ------------------------------------------------------------------------ [2011-12-01 13:37:45] 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é ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=60424&edit=1

« previous php.bugs (#235010) next »