Skip to content

Commit 14c4494

Browse files
committed
Allow UTF-8 variant of C locale
It behaves same in scanf, but it allows proper handling of unicode chars.
1 parent cf85054 commit 14c4494

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/api/baseapi.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,11 @@ TessBaseAPI::TessBaseAPI()
208208
image_height_(0) {
209209
const char *locale;
210210
locale = std::setlocale(LC_ALL, nullptr);
211-
ASSERT_HOST(!strcmp(locale, "C"));
211+
ASSERT_HOST(!strcmp(locale, "C") || !strcmp(locale, "C.UTF-8"));
212212
locale = std::setlocale(LC_CTYPE, nullptr);
213-
ASSERT_HOST(!strcmp(locale, "C"));
213+
ASSERT_HOST(!strcmp(locale, "C") || !strcmp(locale, "C.UTF-8"));
214214
locale = std::setlocale(LC_NUMERIC, nullptr);
215-
ASSERT_HOST(!strcmp(locale, "C"));
215+
ASSERT_HOST(!strcmp(locale, "C") || !strcmp(locale, "C.UTF-8"));
216216
}
217217

218218
TessBaseAPI::~TessBaseAPI() {

0 commit comments

Comments
 (0)