• Mike,

    Thanks for this tool, it's quite useful. It appears that the 'PH' replacement portion needs a fix too.

    -- this part works (it makes a 'P' into an 'F')

       } else if (currentchar == 'P' && nextchar == 'H') {

        enc_char = 'F';

    -- this part takes the 'H' and makes it a 'P' because the original value from the string (P) is being evaluated instead of the encoded value (F). So you end up with 'FP' instead of 'FF' (the 'FF' would be made 'F' by the dupe checker).

       } else if (currentchar == 'H') {

        if (!IsVowel(prevchar) || !IsVowel(nextchar)) {

         {

          if (IsVowel(prevchar))

           enc_char = 'A';

          else

           enc_char = prevchar;

         }

    Example:

    select fn_NYSIIS('joseph')

    Returns: 'JASAFP'

    Thanks again