mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-01-07 18:27:48 +08:00
Merge pull request #1649 from stweil/locale
Test for correct locale settings
This commit is contained in:
commit
e7c1e0739c
@ -43,6 +43,7 @@
|
|||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <clocale>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
@ -185,7 +186,15 @@ TessBaseAPI::TessBaseAPI()
|
|||||||
rect_width_(0),
|
rect_width_(0),
|
||||||
rect_height_(0),
|
rect_height_(0),
|
||||||
image_width_(0),
|
image_width_(0),
|
||||||
image_height_(0) {}
|
image_height_(0) {
|
||||||
|
const char *locale;
|
||||||
|
locale = std::setlocale(LC_ALL, nullptr);
|
||||||
|
ASSERT_HOST(!strcmp(locale, "C"));
|
||||||
|
locale = std::setlocale(LC_CTYPE, nullptr);
|
||||||
|
ASSERT_HOST(!strcmp(locale, "C"));
|
||||||
|
locale = std::setlocale(LC_NUMERIC, nullptr);
|
||||||
|
ASSERT_HOST(!strcmp(locale, "C"));
|
||||||
|
}
|
||||||
|
|
||||||
TessBaseAPI::~TessBaseAPI() {
|
TessBaseAPI::~TessBaseAPI() {
|
||||||
End();
|
End();
|
||||||
|
Loading…
Reference in New Issue
Block a user