function safe(str, col)
		{
			if (typeof str === 'undefined' || str === null)
				return '';

			if (str.constructor === Date)
				return JSON.stringify(str).slice(1, 25);

			var needsQuotes = false;

			if (_escapeFormulae && typeof str === "string" && _escapeFormulae.test(str)) {
				str = "'" + str;
				needsQuotes = true;
			}

			var escapedQuoteStr = str.toString().replace(quoteCharRegex, _escapedQuote);

			needsQuotes = needsQuotes
							|| _quotes === true
							|| (typeof _quotes === 'function' && _quotes(str, col))
							|| (Array.isArray(_quotes) && _quotes[col])
							|| hasAny(escapedQuoteStr, Papa.BAD_DELIMITERS)
							|| escapedQuoteStr.indexOf(_delimiter) > -1
							|| escapedQuoteStr.charAt(0) === ' '
							|| escapedQuoteStr.charAt(escapedQuoteStr.length - 1) === ' ';

			return needsQuotes ? _quoteChar + escapedQuoteStr + _quoteChar : escapedQuoteStr;
		}
Encloses a value around quotes if needed (makes a value safe for CSV insertion)