0

Excel file contain korean text. i don't find solution.. help me!

this is flask code

@app.route('/usecase/excel', methods=['GET', 'POST'])
def get_excel():
    file_name = "usecase.xls"
    return send_from_directory(app.static_folder, file_name)

error occured..

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd0 in position 0: invalid continuation byte
이상훈
  • 11
  • 2
  • 1
    What function raises the `UnicodeDecodeError`? Can you paste the full traceback? What request triggers the failure? You need to give us the input request. – ffledgling Jan 11 '17 at 10:10
  • Maybe this question is related to http://stackoverflow.com/questions/21715132/python-how-to-send-file-from-filesystem-with-a-unicode-filename – dfranca Jan 11 '17 at 10:12
  • unicodeDecodeError: 'utf-8' codec can't decode byte 0xd0 in position 0: invalid continuation byte – 이상훈 Jan 11 '17 at 11:04

1 Answers1

0

As recommended here,

https://stackoverflow.com/a/17681884/5417164

if you want to use in production, you do not want to use flask to serve static files.

Community
  • 1
  • 1
joydeep bhattacharjee
  • 1,249
  • 4
  • 16
  • 42