Added UTF8 encoding and htmlentities to CData function