mirror of
https://github.com/adaptech-cz/Tesseract4Android.git
synced 2026-01-09 06:12:45 +08:00
Fix crash when initializing Tesseract
This commit is contained in:
parent
5d45ed82a0
commit
bda1297090
@ -204,6 +204,8 @@ TessBaseAPI::TessBaseAPI()
|
||||
rect_height_(0),
|
||||
image_width_(0),
|
||||
image_height_(0) {
|
||||
// Tesseract4Android: Android doesn't support setting locale, calling that will result in crash.
|
||||
#ifndef ANDROID
|
||||
const char *locale;
|
||||
locale = std::setlocale(LC_ALL, nullptr);
|
||||
ASSERT_HOST(!strcmp(locale, "C"));
|
||||
@ -211,6 +213,7 @@ TessBaseAPI::TessBaseAPI()
|
||||
ASSERT_HOST(!strcmp(locale, "C"));
|
||||
locale = std::setlocale(LC_NUMERIC, nullptr);
|
||||
ASSERT_HOST(!strcmp(locale, "C"));
|
||||
#endif
|
||||
}
|
||||
|
||||
TessBaseAPI::~TessBaseAPI() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user