function encodeNamedAndNumeric(text, attr) {
				return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) {
					return baseEntities[chr] || entities[chr] || '&#' + chr.charCodeAt(0) + ';' || chr;
				});
			}
Returns an encode function based on the name(s) and it's optional entities.

@method getEncodeFunc
@param {String} name Comma separated list of encoders for example named,numeric.
@param {String} entities Optional parameter with entities to use instead of the built in set.
@return {function} Encode function to be used.