Unable to read Local language data from an Excel using csv

34 views Asked by At

I am giving data as "यह एक नमूना संदेश है" in a CSV file. I am reading the data inside the file using CSV Module in python. sample code:

  csvFile = request.FILES.get('file')
  csv_copy = copy.deepcopy(csvFile)
  file_content = csv_copy.read()
  decoded_file = file_content.decode('utf-8').splitlines()
  reader = csv.reader(decoded_file)
  rows = list(reader)
  for i,row in enumerate(rows):
      print(row[1])

the given data is getting converted as "???? ???? ???" Is there any way to resolve this issue ?

1

There are 1 answers

0
padmaja cherukuri On

Saving CSV file with CSV UTF-8(.csv) format worked. Thanks for the response.