In effect it is not an ascii value for an alphabetical character, if, however, it is not what we are trying to do, but what we want is to substitute the m character for the corresponding one of the key.
For example if the key is key: JTREKYAVOGDXPSNCUIZLFBMWHQ, and we want to encrypt the character m, we must use the character 12 in the key, that is, if we write key as an array we will write key, X.
So, it is necessary to obtain from a character 'A', for example, its position in the alphabet, the first. But since we start counting from 0 (due to the indexing of the arrays) the usual thing is to do for a plain text character:
plaintext[i] - 97 or plaintext[i]% 97 or plaintext[i] - 'a'
plaintext[i] - 65 or plaintext[i] % 65 or plaintext[i] - 'A'
Of course we will do this in a for with the appropriate indexes