Internal method for encoding any unencoded entities in a string.
string to encode
encoded output string
See Implementation
Internal method for encoding any unencoded entities in a string.