refactored esclfhtml function to avoid ASCII string output and removing NL