- PHP:
o Strings with embedded expressions are now recognized.
o Heredoc and Nowdoc strings are now scanned correctly.
+ o The format string directives %E, %F, %g, %G, %h, %H are now regarded as
+ valid.
* Runtime behaviour:
- In the C.UTF-8 locale, like in the C locale, the *gettext() functions
/* PHP format strings.
- Copyright (C) 2001-2004, 2006-2007, 2009, 2019-2020, 2023 Free Software Foundation, Inc.
+ Copyright (C) 2001-2024 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This program is free software: you can redistribute it and/or modify
#define _(str) gettext (str)
-/* PHP format strings are described in phpdoc-4.0.6, file
- phpdoc/manual/function.sprintf.html, and are implemented in
- php-4.1.0/ext/standard/formatted_print.c.
+/* PHP format strings are described in
+ https://www.php.net/manual/en/function.sprintf.php, and are implemented in
+ php-8.1.0/ext/standard/formatted_print.c.
A directive
- starts with '%' or '%m$' where m is a positive integer,
- is optionally followed by any of the characters '0', '-', ' ', or
- is finished by a specifier
- 's', that needs a string argument,
- 'b', 'd', 'u', 'o', 'x', 'X', that need an integer argument,
- - 'e', 'f', that need a floating-point argument,
+ - 'e', 'E', 'f', 'F', 'g', 'G', 'h', 'H', that need a floating-point
+ argument,
- 'c', that needs a character argument.
Additionally there is the directive '%%', which takes no argument.
Numbered and unnumbered argument specifications can be used in the same
case 'b': case 'd': case 'u': case 'o': case 'x': case 'X':
type = FAT_INTEGER;
break;
- case 'e': case 'f':
+ case 'e': case 'E': case 'f': case 'F': case 'g': case 'G':
+ case 'h': case 'H':
type = FAT_FLOAT;
break;
case 'c':
# Valid: one floating-point argument
"abc%e"
# Valid: one floating-point argument
+"abc%E"
+# Valid: one floating-point argument
"abc%f"
+# Valid: one floating-point argument
+"abc%F"
+# Valid: one floating-point argument
+"abc%g"
+# Valid: one floating-point argument
+"abc%G"
+# Valid: one floating-point argument
+"abc%h"
+# Valid: one floating-point argument
+"abc%H"
# Valid: one character argument
"abc%c"
# Valid: one argument with flags
"abc%"
# Invalid: unknown format specifier
"abc%y"
-# Invalid: unknown format specifier
-"abc%F"
# Invalid: flags after width
"abc%5-f"
# Invalid: twice precision
msgstr "xyz%d"
# Valid: type compatibility
msgid "abc%e"
+msgstr "xyz%E"
+# Valid: type compatibility
+msgid "abc%e"
msgstr "xyz%f"
+# Valid: type compatibility
+msgid "abc%e"
+msgstr "xyz%F"
+# Valid: type compatibility
+msgid "abc%e"
+msgstr "xyz%g"
+# Valid: type compatibility
+msgid "abc%e"
+msgstr "xyz%G"
+# Valid: type compatibility
+msgid "abc%e"
+msgstr "xyz%h"
+# Valid: type compatibility
+msgid "abc%e"
+msgstr "xyz%H"
+# Valid: type compatibility
+msgid "abc%E"
+msgstr "xyz%f"
+# Valid: type compatibility
+msgid "abc%E"
+msgstr "xyz%F"
+# Valid: type compatibility
+msgid "abc%E"
+msgstr "xyz%g"
+# Valid: type compatibility
+msgid "abc%E"
+msgstr "xyz%G"
+# Valid: type compatibility
+msgid "abc%E"
+msgstr "xyz%h"
+# Valid: type compatibility
+msgid "abc%E"
+msgstr "xyz%H"
# Invalid: type incompatibility
msgid "abc%s"
msgstr "xyz%d"