Skip to content

Commit

Permalink
unittest/apiexample_test: Use "C" locale
Browse files Browse the repository at this point in the history
We cannot assume that the locale "en_US.UTF-8" is always available.
Using the "C" locale should work better.

Signed-off-by: Stefan Weil <[email protected]>
  • Loading branch information
stweil committed Sep 13, 2017
1 parent 7e4f5fa commit 8655524
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion unittest/apiexample_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
TEST(TesseractTest, ApiExample)
{
char *outText;
std::locale loc("en_US.UTF-8"); // You can also use "" for the default system locale
std::locale loc("C"); // You can also use "" for the default system locale
std::ifstream file("../testing/phototest.txt");
file.imbue(loc); // Use it for file input
std::string gtText((std::istreambuf_iterator<char>(file)),
Expand Down

0 comments on commit 8655524

Please sign in to comment.