Take a look at your constants:
const C0 = 'NORabcdefghilnopqrstuvy'; // plus space that is not following a space
const C6 = 'CHLMPQSTUVfkmspwx ';
The characters 'f', 's' and 'p' appear twice. This can't be correct?
I am assuming that C0 is used for these letters?