8000 CODEC-127 - fix mangled characters · step-security-bot/commons-codec@0c6a06c · GitHub
Skip to content

Commit 0c6a06c

Browse files
committed
CODEC-127 - fix mangled characters
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/branches/generics@1157596 13f79535-47bb-0310-9956-ffa450edef68
1 parent c80a364 commit 0c6a06c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/test/org/apache/commons/codec/language/SoundexTest.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -364,15 +364,16 @@ public void testUsEnglishStatic() {
364364
@Test
365365
public void testUsMappingEWithAcute() {
366366
Assert.assertEquals("E000", this.getSoundexEncoder().encode("e"));
367-
if (Character.isLetter('')) {
367+
if (Character.isLetter('\u00e9')) { // e-acute
368368
try {
369-
Assert.assertEquals("�000", this.getSoundexEncoder().encode("�"));
369+
// uppercase E-acute
370+
Assert.assertEquals("\u00c9000", this.getSoundexEncoder().encode("\u00e9"));
370371
Assert.fail("Expected IllegalArgumentException not thrown");
371372
} catch (IllegalArgumentException e) {
372373
// expected
373374
}
374375
} else {
375-
Assert.assertEquals("", this.getSoundexEncoder().encode(""));
376+
Assert.assertEquals("", this.getSoundexEncoder().encode("\u00e9"));
376377
}
377378
}
378379

@@ -384,15 +385,16 @@ public void testUsMappingEWithAcute() {
384385
@Test
385386
public void testUsMappingOWithDiaeresis() {
386387
Assert.assertEquals("O000", this.getSoundexEncoder().encode("o"));
387-
if (Character.isLetter('')) {
388+
if (Character.isLetter('\u00f6')) { // o-umlaut
388389
try {
389-
Assert.assertEquals("�000", this.getSoundexEncoder().encode("�"));
390+
// uppercase O-umlaut
391+
Assert.assertEquals("\u00d6000", this.getSoundexEncoder().encode("\u00f6"));
390392
Assert.fail("Expected IllegalArgumentException not thrown");
391393
} catch (IllegalArgumentException e) {
392394
// expected
393395
}
394396
} else {
395-
Assert.assertEquals("", this.getSoundexEncoder().encode(""));
397+
Assert.assertEquals("", this.getSoundexEncoder().encode("\u00f6"));
396398
}
397399
}
398400
}

0 commit comments

Comments
 (0)