Merge pull request #2272 from nijel/patch-1

Allow UTF-8 variant of C locale
This commit is contained in:
Stefan Weil 2019-02-26 22:25:48 +01:00 committed by GitHub
commit 13bd96fd37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -208,11 +208,11 @@ TessBaseAPI::TessBaseAPI()
image_height_(0) {
const char *locale;
locale = std::setlocale(LC_ALL, nullptr);
ASSERT_HOST(!strcmp(locale, "C"));
ASSERT_HOST(!strcmp(locale, "C") || !strcmp(locale, "C.UTF-8"));
locale = std::setlocale(LC_CTYPE, nullptr);
ASSERT_HOST(!strcmp(locale, "C"));
ASSERT_HOST(!strcmp(locale, "C") || !strcmp(locale, "C.UTF-8"));
locale = std::setlocale(LC_NUMERIC, nullptr);
ASSERT_HOST(!strcmp(locale, "C"));
ASSERT_HOST(!strcmp(locale, "C") || !strcmp(locale, "C.UTF-8"));
}
TessBaseAPI::~TessBaseAPI() {