mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-04 05:44:53 +00:00
Output format depends on the POSIX locale LC_NUMERIC #740
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @v-chvila on GitHub (Feb 28, 2023).
For example:
b488126d09/src/lib_ccx/ccx_encoders_smptett.c (L221)sprintf()is configured by LC_NUMERIC. See: https://linux.die.net/man/3/sprintfFormat of the format stringFinal output is inconsistent and it is hard to parse. Do you consider some better solution?
@marcybelardo commented on GitHub (Mar 19, 2023):
We can specify a locale before using sprintf to get the formatting we want, and then immediately return locale to C afterwards I believe?
@marcybelardo commented on GitHub (Mar 19, 2023):
The more I research, the more I think locales are a nightmare. I might try a fix for this, but wow
@cfsmp3 commented on GitHub (Mar 19, 2023):
The simplest solution is two just don't use float and use two ints instead. Here's what ChatGPT suggest (I haven't tried, but it gives you an idea)
Forget about locales :-)
@marcybelardo commented on GitHub (Mar 20, 2023):
Oh I see! I thought that they had to stay as floats :P
@cfsmp3 commented on GitHub (Mar 20, 2023):
No - just make sure the output is correct, i.e. always 3 digits (test for numbers ending in 0, 00, 000)...
@cfsmp3 commented on GitHub (Mar 22, 2023):
@v-chvila Could you see if it's fixed for you in master?
@cfsmp3 commented on GitHub (Mar 27, 2023):
Closing. @v-chvila feel free to reopen if you still have problems.