Skip to content

Commit 0e32dac

Browse files
committed
fixed:English search unsupport
1 parent 4a58074 commit 0e32dac

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

utils/content_check.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ func ContainsCJK(s string) bool {
1010
(r >= 0x2A700 && r <= 0x2B73F) || // Extension C
1111
(r >= 0x2B740 && r <= 0x2B81F) || // Extension D
1212
(r >= 0x2B820 && r <= 0x2CEAF) || // Extension E
13-
(r >= 0xF900 && r <= 0xFAFF) { // CJK Compatibility Ideographs
13+
(r >= 0xF900 && r <= 0xFAFF) ||
14+
(r >= 0x61 && r <= 0x7A) ||
15+
(r >= 0x41 && r <= 0x5A) { // CJK Compatibility Ideographs
1416
return true
1517
}
1618
}

utils/content_check_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ func TestContentCheck(t *testing.T) {
66
tests := []string{
77
"Hello, world!",
88
"你好,世界!",
9-
"今日は世界",
109
"Bonjour le monde!",
1110
"1234567890",
1211
"!@#$%^&*()_+",
1312
}
14-
expected := []bool{false, true, true, false, false, false}
13+
expected := []bool{true, true, true, false, false}
1514
for i, test := range tests {
1615
result := ContainsCJK(test)
1716
if result != expected[i] {

0 commit comments

Comments
 (0)