Base: revert to using ASCII chararacters for imperial lengths

The new unit schema management is using U+2032 and U+2033 characters
for feet and inches while parser is expecting only ' and ", while
U+2032 and U+2033 are used for arcminute and arcsecond.

While this is not an ideal solution and parser should deal with both,
revert back to ASCII for now.

Fixes: 1155f0d752 ("Base: simplify UnitsSchemas management")
This commit is contained in:
Ladislav Michl
2025-05-14 10:24:02 +02:00
parent 67d0345870
commit 602880ed80
3 changed files with 23 additions and 20 deletions

View File

@@ -103,12 +103,13 @@ UnitsSchema::toLocale(const Quantity& quant, const double factor, const std::str
std::string valueString =
Lc.toString((quant.getValue() / factor), format.toFormat(), format.precision).toStdString();
return fmt::format(
"{}{}{}",
valueString,
unitString.empty() || unitString == "°" || unitString == "" || unitString == "" ? ""
: " ",
unitString);
return fmt::format("{}{}{}",
valueString,
unitString.empty() || unitString == "°" || unitString == ""
|| unitString == "" || unitString == "\"" || unitString == "'"
? ""
: " ",
unitString);
}
bool UnitsSchema::isMultiUnitLength() const