-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do we really need ASCII-only text output? #540
Comments
We can follow [time.duration.io]:
|
Yes, we could, but I do not think that is a good idea. For chrono it was one exception case. For our library there are plenty of cases like that. |
Our support for ASCII can be one exception case in the specification. |
I think that is not an option. The alternative symbol for each Unicode sign has to be explicitly provided so that text logs from one application can be then read as input by the other (see #541). |
Does it? |
From a standardization perspective, symbols that utilize only characters from the basic literal character set are required since the complete set of Unicode characters is not supported by all character encodings allowed by the C++ standard. I think the question posed in this issue is therefore misguided. I believe the desired design is for a unit specification to have a preferred symbol selected from all of the characters available in the Unicode standard as well as a fallback symbol selected from the basic literal character set ([lex.charset]p7). By default, the preferred symbol would be used if the target encoding supports the full range of Unicode characters and the fallback symbol used otherwise. For those that wish to restrict output to ASCII-only, an option should be provided to use the fallback symbol in cases where the preferred symbol could otherwise be used but is not desired. |
Exactly! I tried to form a question so that most C++ developers would understand it. I believe that most have heard about ASCII but may have no clue what "basic literal character set" means 😉 Anyway, the main question remains. Do we want to limit the implementation to The Unicode characters only, or do we also want to provide a fallback option? Having both complicates the design and potential support for text input in the future, but may be required by some users, and I would love to hear about such cases. |
@ChrisRyan98008 stated on LinkedIn:
|
@ChrisRyan98008 also suggested:
For now, we do not plan to provide a translation layer for text output, but a user could probably do something on their own to implement it. Please let us know in case someone has a good idea of how to incorporate such a feature into the framework. |
A fallback symbol is required for standardization since there is no guarantee that characters outside the basic literal character set are representable at all. That fallback symbol is needed regardless of whether the proposed The question to be posed is, is the |
Use case : I use my quantities library on 8bit mcu .eg https://github.com/kwikius/ultrasonic_wind_sensor/blob/master/libraries/UltrasonicWindSensor/wind_sensor_impl.cpp. ( Atmega328 ) For that type of use, the serial port is often used for output with ascii text. |
Based on the feedback we got, we decide to leave ASCII-only text output. |
Besides the Unicode text output mp-units provides the ability to output ASCI-only text as well.
Standardizing such ASCII-only text output will be hard as ISO and SI standards do not specify alternative ASCII characters for those. This means we will have to guess and use some arbitrary things. Moreover, this complicates the design (e.g., requires an additional
unit_symbol
class template that stores twofixed_string
objects).Please let us know if you have issues with removing support for ASCII-only output and what is the rationale for keeping it.
The text was updated successfully, but these errors were encountered: