From a135324c8ca5add577008162263443d4cd670df6 Mon Sep 17 00:00:00 2001 From: GlocKieHuan <77883010+GlocKieHuan@users.noreply.github.com> Date: Mon, 9 Jun 2025 10:27:16 +0800 Subject: [PATCH] Fix isspace on windows in debug build (#2042) --- sherpa-onnx/csrc/text-utils.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sherpa-onnx/csrc/text-utils.cc b/sherpa-onnx/csrc/text-utils.cc index 3f390476..37e84f0b 100644 --- a/sherpa-onnx/csrc/text-utils.cc +++ b/sherpa-onnx/csrc/text-utils.cc @@ -312,7 +312,7 @@ static std::vector MergeCharactersIntoWords( while (i < n) { const auto &w = words[i]; if (w.size() >= 3 || (w.size() == 2 && !IsSpecial(w)) || - (w.size() == 1 && (IsPunct(w[0]) || std::isspace(w[0])))) { + (w.size() == 1 && (IsPunct(w[0]) || std::isspace(static_cast(w[0]))))) { if (prev != -1) { std::string t; for (; prev < i; ++prev) { @@ -322,7 +322,7 @@ static std::vector MergeCharactersIntoWords( ans.push_back(std::move(t)); } - if (!std::isspace(w[0])) { + if (!std::isspace(static_cast(w[0]))) { ans.push_back(w); } ++i;