Shared method for encoding HTML special chars.
By default don't double encode already existing HTML chars.