From 4affc832d6f631163bd8cbe31dcf5f83faab7817 Mon Sep 17 00:00:00 2001 From: Looly Date: Mon, 24 Mar 2025 08:51:18 +0800 Subject: [PATCH] =?UTF-8?q?`StrUtil.isBlank`=E5=A2=9E=E5=8A=A0`\u200c`?= =?UTF-8?q?=E5=88=A4=E6=96=AD=EF=BC=88issue#3903@Github=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/org/dromara/hutool/core/text/CharUtil.java | 2 ++ .../java/org/dromara/hutool/core/text/CharUtilTest.java | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/hutool-core/src/main/java/org/dromara/hutool/core/text/CharUtil.java b/hutool-core/src/main/java/org/dromara/hutool/core/text/CharUtil.java index 323c7911d..a7d761487 100644 --- a/hutool-core/src/main/java/org/dromara/hutool/core/text/CharUtil.java +++ b/hutool-core/src/main/java/org/dromara/hutool/core/text/CharUtil.java @@ -278,6 +278,8 @@ public class CharUtil implements CharPool { || c == '\u3164' // Braille Pattern Blank || c == '\u2800' + // Zero Width Non-Joiner, ZWNJ + || c == '\u200c' // MONGOLIAN VOWEL SEPARATOR || c == '\u180e'; } diff --git a/hutool-core/src/test/java/org/dromara/hutool/core/text/CharUtilTest.java b/hutool-core/src/test/java/org/dromara/hutool/core/text/CharUtilTest.java index 4e583c431..0bd4e4734 100644 --- a/hutool-core/src/test/java/org/dromara/hutool/core/text/CharUtilTest.java +++ b/hutool-core/src/test/java/org/dromara/hutool/core/text/CharUtilTest.java @@ -19,6 +19,8 @@ package org.dromara.hutool.core.text; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertTrue; + public class CharUtilTest { @Test @@ -56,7 +58,10 @@ public class CharUtilTest { Assertions.assertTrue(CharUtil.isBlankChar(a3)); final char a4 = '\u0000'; - Assertions.assertTrue(CharUtil.isBlankChar(a4)); + assertTrue(CharUtil.isBlankChar(a4)); + + final char a6 = '\u200c'; + assertTrue(CharUtil.isBlankChar(a6)); } @Test