def read_csv_content(fcontent, ignore_encoding=False):
	rows = []

	if not isinstance(fcontent, unicode):
		decoded = False
		for encoding in ["utf-8", "windows-1250", "windows-1252"]:
			try:
				fcontent = unicode(fcontent, encoding)
				decoded = True
				break
			except __HOLE__:
				continue

		if not decoded:
			frappe.msgprint(_("Unknown file encoding. Tried utf-8, windows-1250, windows-1252."),
				raise_exception=True)

	fcontent = fcontent.encode("utf-8").splitlines(True)

	try:
		rows = []
		for row in csv.reader(fcontent):
			r = []
			for val in row:
				# decode everything
				val = unicode(val, "utf-8").strip()

				if val=="":
					# reason: in maraidb strict config, one cannot have blank strings for non string datatypes
					r.append(None)
				else:
					r.append(val)

			rows.append(r)

		return rows

	except Exception:
		frappe.msgprint(_("Not a valid Comma Separated Value (CSV File)"))
		raise
dataset/ETHPy150Open frappe/frappe/frappe/utils/csvutils.py/read_csv_content