Skip to content

Commit

Permalink
Allow UTF-8 variant of C locale
Browse files Browse the repository at this point in the history
It behaves same in scanf, but it allows proper handling of unicode
chars.
  • Loading branch information
nijel committed Feb 26, 2019
1 parent cf85054 commit 14c4494
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/api/baseapi.cpp
Expand Up @@ -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() {
Expand Down

0 comments on commit 14c4494

Please sign in to comment.