Skip to content

Commit 43033b7

Browse files
authored
llama-bench : set locale to utf8 (#2832)
1 parent 6b73ef1 commit 43033b7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

examples/llama-bench/llama-bench.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@
33
#include <cassert>
44
#include <chrono>
55
#include <cinttypes>
6+
#include <clocale>
7+
#include <cmath>
8+
#include <cstdio>
69
#include <cstring>
710
#include <ctime>
811
#include <iterator>
912
#include <map>
1013
#include <numeric>
1114
#include <regex>
1215
#include <sstream>
13-
#include <stdio.h>
1416
#include <string>
1517
#include <vector>
1618

@@ -916,6 +918,9 @@ static void llama_null_log_callback(enum llama_log_level level, const char * tex
916918
}
917919

918920
int main(int argc, char ** argv) {
921+
// try to set locale for unicode characters in markdown
922+
setlocale(LC_CTYPE, ".UTF-8");
923+
919924
#if !defined(NDEBUG)
920925
fprintf(stderr, "warning: asserts enabled, performance may be affected\n");
921926
#endif

0 commit comments

Comments
 (0)