diff options
author | slaren <slarengh@gmail.com> | 2023-08-28 19:19:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-28 19:19:18 +0200 |
commit | 43033b7bb4858da4f591715b3babdf906c9b7cbc (patch) | |
tree | 642d8a31fe492e3d659f93839a6748dbdccf0553 | |
parent | 6b73ef120114beb5664ea94aab48d07ed248ee52 (diff) |
llama-bench : set locale to utf8 (#2832)
-rwxr-xr-x | examples/llama-bench/llama-bench.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/llama-bench/llama-bench.cpp b/examples/llama-bench/llama-bench.cpp index d0fe6d90..bf3a487a 100755 --- a/examples/llama-bench/llama-bench.cpp +++ b/examples/llama-bench/llama-bench.cpp @@ -3,6 +3,9 @@ #include <cassert> #include <chrono> #include <cinttypes> +#include <clocale> +#include <cmath> +#include <cstdio> #include <cstring> #include <ctime> #include <iterator> @@ -10,7 +13,6 @@ #include <numeric> #include <regex> #include <sstream> -#include <stdio.h> #include <string> #include <vector> @@ -916,6 +918,9 @@ static void llama_null_log_callback(enum llama_log_level level, const char * tex } int main(int argc, char ** argv) { + // try to set locale for unicode characters in markdown + setlocale(LC_CTYPE, ".UTF-8"); + #if !defined(NDEBUG) fprintf(stderr, "warning: asserts enabled, performance may be affected\n"); #endif |