[LOGMGR-104] Fix bad encoding algorithm.
Use String.charAt() rather than String.toCharArray() to save a new array from getting created.