php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #58005 Quotes in message formats are counterintuitive
Submitted: 2008-01-11 19:04 UTC Modified: 2008-03-06 13:05 UTC
From: stas at zend dot com Assigned:
Status: Closed Package: intl (PECL)
PHP Version: 5.2.1 OS:
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 !
Your email address:
MUST BE VALID
Solve the problem:
9 + 20 = ?
Subscribe to this entry?

 
 [2008-01-11 19:04 UTC] stas at zend dot com
Description:
------------
Java's MessageFormat treats ' (single quote) as escape character, so this:

<?php
  $fmt = new MessageFormatter("en_US", "Jack's mother is {1, number} years old ");
  echo "result is:". $fmt->format(array(70));
  echo "pattern is:".$fmt->getPattern()."\n";
?>

would produce:

result is:Jacks mother is {1, number} years old     
pattern is:Jacks mother is '{'1, number} years old 

See also:
http://bugs.sun.com/view_bug.do?bug_id=4862106


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-03-06 13:05 UTC] stas at zend dot com
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.

Now uses autoquote.
 [2021-01-29 14:53 UTC] thomasallison603 at gmail dot com
She would like to see them ever happy in their own future days. She constructs base to prepare future that is glowing and teaches us courses that are great.
https://wishmothersday.com/happy-mothers-day-wishes-messages.html
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Oct 15 20:03:45 2021 UTC