nolocale-test defines FMT_STATIC_THOUSANDS_SEPARATOR, which stopped doing
anything in b90b4bc9 ("Remove FMT_STATIC_THOUSANDS_SEPARATOR in favor of
FMT_USE_LOCALE"). That macro no longer appears anywhere under include/, so
since then the target has compiled src/format.cc with locale support enabled.
It is not a dead target: the pedantic CI jobs build it (linux.yml, macos.yml
both pass -DFMT_PEDANTIC=ON), and it passes. So the configuration looks
covered while nothing actually tests it. #4627 - a locale-off build break -
landed during that window.
Define FMT_USE_LOCALE=0 instead.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
nolocale-test compiles src/format.cc directly, so it does not pick up the
/utf-8 that CMakeLists.txt adds to the fmt target. On MSVC the static_assert
in base.h then fires: "Unicode support requires compiling with /utf-8".
The target only exists under FMT_PEDANTIC, which the Windows workflow does not
set, so this has not shown up in CI. unicode-test already guards the same flag
the same way.
One of its unique features is that it serializes the format
string and all format arguments to the thread's SPSQ queue
to minimize processing on hotpath and then deserializes them
on the backend thread which performs formatting using {fmt}
and writing to the log sinks.
Signed-off-by: Alexander Lobakin <alobakin@mailbox.org>
The '0' modifier was documented in ca8eeb09 (#3976) and the parser case for
it was removed nine days later in 7bd11b5c ("Remove a redundant extension to
reduce divergence from std::format"), which did not update the docs. Since
then the grammar and the modifier table have promised a modifier that
parse_chrono_format rejects with "invalid format", for all 11 of the
presentation types the same section lists as supporting it.
Zero padding remains the default, so the extension really was redundant;
this only aligns the documentation with the code.
Co-authored-by: Dylan Pulver <dylanpulver@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
* Widen display_width_of() to cover Emoji_Presentation code points
fmt::detail::display_width_of() only treated East Asian Wide/Fullwidth
code points and two hand-picked emoji ranges as two columns wide, so
emoji outside those ranges (e.g. the Dingbats block: cross mark U+274C,
white heavy check mark U+2705) were measured as one column even though
most terminals render them double-width. This produced visibly
inconsistent padding under {:^N} compared to CJK text (fixes#4851).
Replaced the ad hoc boolean expression with a sorted table of ranges
(East Asian Wide/Fullwidth plus the full Emoji_Presentation set from
Unicode's emoji-data.txt) looked up via binary search, and added
regression tests covering the original report plus edge cases:
multiple emoji, mixed emoji/CJK/ASCII content, precision truncation,
alignment/fill variants, newly covered emoji ranges, and regional
indicator (flag) pairs.
* Make wide_cp_ranges C++11-compatible; apply clang-format
* Move wide_cp_range struct into display_width_of()
* Derive wide_cp_ranges from East_Asian_Width data, restore constexpr
* Move wide_cp_ranges to display_width_of function body
* Update format.h
* Update wide_cp_ranges array to include comments
* Add inline to display_width_of and add 1F300-1F5FF and 1F900-1F9FF ranges to match [format.string.std]
* Update display_width_of lo hi varible declaration
---------
Co-authored-by: Eduardo Gomez Saldias <50159560+edugomez102@users.noreply.github.com>
Don't inject -freflection when building the module, so it isn't forced onto
the module or its importers. Build enum-test unconditionally (it is a no-op
without reflection) and drop the now-unneeded reflection detection. Enable
reflection explicitly in the g++-16 C++26 CI job.
Use std::string_view directly for enumerator identifiers, dropping the
identifier wrapper and inlining count_enumerators. Update the fmt/enum.h
documentation to point at cppreference and drop an inaccurate note. Also
remove the no-longer-needed -Wno-sfinae-incomplete option for format-test.