Skip to content

Commit

Permalink
Specify POSIX locale for numerics
Browse files Browse the repository at this point in the history
  • Loading branch information
cfsmp3 committed Mar 22, 2023
1 parent 0b6a898 commit 2956275
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ccextractor.c
Expand Up @@ -48,7 +48,6 @@ int api_start(struct ccx_s_options api_options)
#if defined(ENABLE_OCR) && defined(_WIN32)
setMsgSeverity(LEPT_MSG_SEVERITY);
#endif

// Initialize CCExtractor libraries
ctx = init_libraries(&api_options);

Expand Down Expand Up @@ -438,6 +437,9 @@ struct ccx_s_options *api_init_options()
int main(int argc, char *argv[])
{
setlocale(LC_ALL, ""); // Supports non-English CCs
// Use POSIX locale for numbers so we get "." as decimal separator and no
// thousands' groupoing instead of what the locale might say
setlocale (LC_NUMERIC, "POSIX");

struct ccx_s_options *api_options = api_init_options();
parse_configuration(api_options);
Expand Down

0 comments on commit 2956275

Please sign in to comment.