Removed replaceAll functions from encodeString