Optionally exclude Unicode data

This commit is contained in:
Victor Zverovich 2024-09-08 16:36:02 -07:00
parent b37be85bf1
commit 3ada4aed20

View File

@ -1844,8 +1844,9 @@ auto write_ptr(OutputIt out, UIntPtr value, const format_specs* specs)
FMT_API auto is_printable(uint32_t cp) -> bool;
inline auto needs_escape(uint32_t cp) -> bool {
return cp < 0x20 || cp == 0x7f || cp == '"' || cp == '\\' ||
!is_printable(cp);
if (cp < 0x20 || cp == 0x7f || cp == '"' || cp == '\\') return true;
if (FMT_OPTIMIZE_SIZE > 1) return false;
return !is_printable(cp);
}
template <typename Char> struct find_escape_result {