finished writing html encoding for string