### CI Link

https://gradle-enterprise.elastic.co/s/323cgxy7itfky

### Repro line

REPRODUCE WITH: ./gradlew ':server:test' --tests "org.elasticsearch.common.StringsTests.testDeleteAny" -Dtests.seed=8A64C9DD086550D3 -Dtests.locale=it -Dtests.timezone=Asia/Baghdad -Druntime.java=17	

### Does it reproduce?

Yes

### Applicable branches

main

### Failure history

https://gradle-enterprise.elastic.co/scans/tests?search.timeZoneId=Europe/Rome&tests.container=org.elasticsearch.common.StringsTests&tests.test=testDeleteAny

### Failure excerpt

```
java.lang.AssertionError: |  
  | Expected: "짞ĐGⰣ*ﮢ" |  
  | but: was "짞ĐGⰣﮢ"
```
server/src/test/java/org/elasticsearch/common/StringsTests.java
assertFalse(hasText(null));
        assertFalse(hasText(""));
        assertFalse(hasText(" "));
        assertTrue(hasText("12345"));
        assertTrue(hasText(" 12345 "));
        String asciiWhitespace = IntStream.rangeClosed(0, 32)
            .filter(Character::isWhitespace)
            .mapToObj(Character::toString)
            .collect(Collectors.joining());
        assertFalse(hasText(asciiWhitespace));
        assertTrue(hasText("\ud855\udddd"));
    }
    public void testIsAllOrWildCardString() {
        assertThat(isAllOrWildcard("_all"), is(true));
        assertThat(isAllOrWildcard("*"), is(true));
        assertThat(isAllOrWildcard("foo"), is(false));
        assertThat(isAllOrWildcard(""), is(false));
        assertThat(isAllOrWildcard((String) null), is(false));
    }
    public void testSubstring() {
        assertNull(substring(null, 0, 1000));
        assertEquals("foo", substring("foo", 0, 1000));
        assertEquals("foo", substring("foo", 0, 3));
        assertEquals("oo", substring("foo", 1, 3));
        assertEquals("oo", substring("foo", 1, 100));
        assertEquals("f", substring("foo", 0, 1));
    }
    public void testCleanTruncate() {
        assertNull(cleanTruncate(null, 10));
        assertEquals("foo", cleanTruncate("foo", 10));