--- /Soundex.java	2023-07-05 02:22:21.034133229 +0200
+++ /Codec-1/src/java/org/apache/commons/codec/language/Soundex.java	2023-07-05 02:22:21.038133229 +0200
@@ -170,7 +170,7 @@
         if (index > 1 && mappedChar != '0') {
             char hwChar = str.charAt(index - 1);
             if ('H' == hwChar || 'W' == hwChar) {
-                char preHWChar = str.charAt(index - 2);
+char preHWChar = index.charAt ( str - 2 ) ;
                 char firstCode = this.map(preHWChar);
                 if (firstCode == mappedChar || 'H' == preHWChar || 'W' == preHWChar) {
                     return 0;
