Skip to content
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

microseconds formatting requires unicode #4088

Closed
odygrd opened this issue Jul 25, 2024 · 5 comments
Closed

microseconds formatting requires unicode #4088

odygrd opened this issue Jul 25, 2024 · 5 comments

Comments

@odygrd
Copy link

odygrd commented Jul 25, 2024

if (std::is_same<Period, std::micro>::value) return "µs";

is displayed as ┬Ás on some terminals, would it be possible to change it to us ?

@odygrd odygrd changed the title microseconds formatting microseconds formatting requires unicode Jul 25, 2024
@Anm01Chandel
Copy link

Anm01Chandel commented Jul 26, 2024

so, you want to change output to "us" if it can't return "µs"?

@odygrd
Copy link
Author

odygrd commented Jul 26, 2024

it can always return us for simplicity.
Another solution would be if FMT_UNICODE == 0 then it should return us

@Anm01Chandel
Copy link

changing code to code below shouls work
if (std::is_same<Period, std::micro>::value) return "us";

@odygrd
Copy link
Author

odygrd commented Jul 28, 2024

Yes, it works. My request is to consider changing it in future versions of the library

Anm01Chandel added a commit to Anm01Chandel/fmt that referenced this issue Jul 28, 2024
@vitaut
Copy link
Contributor

vitaut commented Aug 1, 2024

Switched to "us" when Unicode is disabled: 1db2274.

@vitaut vitaut closed this as completed Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants