From 7c975a0eeeb538a2d920c2ff3419480bf49838d9 Mon Sep 17 00:00:00 2001 From: Egor Pugin Date: Wed, 24 Mar 2021 14:36:40 +0300 Subject: [PATCH] Remove default locale setting in debug config. Any locale errors must be fixed separately (if any). Fixes #3290. --- src/api/baseapi.cpp | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/api/baseapi.cpp b/src/api/baseapi.cpp index bcba45c028..13e359f7f1 100644 --- a/src/api/baseapi.cpp +++ b/src/api/baseapi.cpp @@ -228,20 +228,6 @@ TessBaseAPI::TessBaseAPI() , rect_height_(0) , image_width_(0) , image_height_(0) { -#if !defined(NDEBUG) - // The Tesseract executables would use the "C" locale by default, - // but other software which is linked against the Tesseract library - // typically uses the locale from the user's environment. - // Here the default is overridden to allow debugging of potential - // problems caused by the locale settings. - - // Use the current locale if building debug code. - try { - std::locale::global(std::locale("")); - } catch (const std::runtime_error &ex) { - fprintf(stderr, "Warning: Could not set the current locale\n"); - } -#endif } TessBaseAPI::~TessBaseAPI() {