From 08b6a51b22ff6789da760d7651ab602e4f4ae500 Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Wed, 23 Oct 2024 22:12:53 +0200 Subject: [PATCH] refactor: framework Unicode symbols are now spelled using their codes --- src/core/include/mp-units/framework/magnitude.h | 8 ++++---- src/core/include/mp-units/framework/unit.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/include/mp-units/framework/magnitude.h b/src/core/include/mp-units/framework/magnitude.h index 792411bc3..3fae880c3 100644 --- a/src/core/include/mp-units/framework/magnitude.h +++ b/src/core/include/mp-units/framework/magnitude.h @@ -313,7 +313,7 @@ constexpr Out print_separator(Out out, const unit_symbol_formatting& fmt) if (fmt.encoding != text_encoding::utf8) MP_UNITS_THROW( std::invalid_argument("'unit_symbol_separator::half_high_dot' can be only used with 'text_encoding::utf8'")); - const std::string_view dot = "⋅"; + const std::string_view dot = "\u22C5"; out = detail::copy(dot.begin(), dot.end(), out); } else { *out++ = ' '; @@ -393,7 +393,7 @@ constexpr Out magnitude_symbol_impl(Out out, const unit_symbol_formatting& fmt) if constexpr (Exp10 != 0) { if (numerator || denominator) { - constexpr auto mag_multiplier = symbol_text(u8" × ", " x "); + constexpr auto mag_multiplier = symbol_text(u8" \u00D7 ", " x "); out = copy_symbol(mag_multiplier, fmt.encoding, negative_power, out); } constexpr auto exp = symbol_text("10") + detail::superscript(); @@ -690,10 +690,10 @@ constexpr Magnitude auto mag_power = _pow(mag); * @brief A convenient Magnitude constant for pi, which we can manipulate like a regular number. */ #if defined MP_UNITS_COMP_CLANG || MP_UNITS_COMP_CLANG < 18 -inline constexpr struct pi final : mag_constant { +inline constexpr struct pi final : mag_constant { static constexpr auto _value_ = std::numbers::pi_v; #else -inline constexpr struct pi final : mag_constant> { +inline constexpr struct pi final : mag_constant> { #endif } pi; inline constexpr auto 𝜋 = pi; diff --git a/src/core/include/mp-units/framework/unit.h b/src/core/include/mp-units/framework/unit.h index e4a6dc2ab..3624e243d 100644 --- a/src/core/include/mp-units/framework/unit.h +++ b/src/core/include/mp-units/framework/unit.h @@ -650,7 +650,7 @@ template // common dimensionless units // clang-format off inline constexpr struct percent final : named_unit<"%", mag_ratio<1, 100> * one> {} percent; -inline constexpr struct per_mille final : named_unit * one> {} per_mille; +inline constexpr struct per_mille final : named_unit * one> {} per_mille; inline constexpr struct parts_per_million final : named_unit<"ppm", mag_ratio<1, 1'000'000> * one> {} parts_per_million; inline constexpr auto ppm = parts_per_million; // clang-format on