Skip to content

Commit a135324

Browse files
authored
Fix isspace on windows in debug build (#2042)
1 parent e13f7db commit a135324

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sherpa-onnx/csrc/text-utils.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ static std::vector<std::string> MergeCharactersIntoWords(
312312
while (i < n) {
313313
const auto &w = words[i];
314314
if (w.size() >= 3 || (w.size() == 2 && !IsSpecial(w)) ||
315-
(w.size() == 1 && (IsPunct(w[0]) || std::isspace(w[0])))) {
315+
(w.size() == 1 && (IsPunct(w[0]) || std::isspace(static_cast<uint8_t>(w[0]))))) {
316316
if (prev != -1) {
317317
std::string t;
318318
for (; prev < i; ++prev) {
@@ -322,7 +322,7 @@ static std::vector<std::string> MergeCharactersIntoWords(
322322
ans.push_back(std::move(t));
323323
}
324324

325-
if (!std::isspace(w[0])) {
325+
if (!std::isspace(static_cast<uint8_t>(w[0]))) {
326326
ans.push_back(w);
327327
}
328328
++i;

0 commit comments

Comments
 (0)