std::format locale‑aware Unicode formatting constraints
0 reputation · 19 Jun 2021, 17:14 UTC
Feature: std::format (C++23)
Developers use std::format to generate user‑facing text that is type‑safe and optionally locale‑aware. The goal is to produce output that is both visually correct and accessible to screen‑reader users across different locales.
Missing Constraint
The C++23 standard does not specify how locale‑specific formatting (digit grouping, currency symbols, ordinal suffixes) should be rendered for screen‑reader consumption. Without a clear rule, the visual representation may differ from the auditory output, breaking accessibility.
Unresolved Behavior
When formatting Unicode strings that contain combining characters or right‑to‑left scripts, the standard leaves the order and presentation of code points unspecified. Screen‑reader tools may read the characters in an unexpected sequence, leading to misinterpretation.
Questions
- What constraints should the standard impose on
std::formatto ensure that locale‑specific formatting is consistently interpreted by screen readers? - How should
std::formathandle combining characters and bidirectional text to preserve the intended order for auditory rendering? - Would a locale‑aware formatting policy require additional metadata or a new formatting facet to guide accessibility tools?