From fb3b27a67a10aba20c4ad24c8d5f0240cdbb5440 Mon Sep 17 00:00:00 2001 From: Jensfrank Date: Sat, 7 Sep 2024 22:53:26 +0800 Subject: [PATCH] Update Nlbench.sh --- Nlbench.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Nlbench.sh b/Nlbench.sh index d275a91..e3101c1 100644 --- a/Nlbench.sh +++ b/Nlbench.sh @@ -452,7 +452,8 @@ generate_markdown_output() { local file_suffixes=("yabs" "fusion" "ip_quality" "streaming" "response" "multi_thread" "single_thread" "route") local empty_tabs=("去程路由" "Ping.pe" "哪吒 ICMP" "其他") - echo "[tabs]" > "$temp_output_file" + # 修改这里,添加 UTF-8 编码设置 + echo "[tabs]" | iconv -f UTF-8 -t UTF-8//IGNORE > "$temp_output_file" for i in "${!sections[@]}"; do section="${sections[$i]}" @@ -474,10 +475,6 @@ generate_markdown_output() { echo "[/tabs]" >> "$temp_output_file" - # 确保文件以 UTF-8 编码保存 - iconv -f UTF-8 -t UTF-8 "$temp_output_file" -o "${temp_output_file}.utf8" - mv "${temp_output_file}.utf8" "$temp_output_file" - local timestamp=$(date +"%Y%m%d%H%M%S") local random_chars=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 6 | head -n 1) local filename="${timestamp}-${random_chars}.txt"