0

Basically, when user uploads the file I am writing that file into NFS. But it gives an error 'ascii' codec can't encode characters in position 28-32: ordinal not in range(128)

I have tried to install Chinese locale and set it but it is not working

I am taking the file name as this but it is not working

file_name = file_name.encode('ascii').decode('unicode-escape')
Travis Webb
  • 14,134
  • 6
  • 53
  • 104
Vimox Shah
  • 89
  • 8
  • I've found this [post](https://stackoverflow.com/questions/9942594/unicodeencodeerror-ascii-codec-cant-encode-character-u-xa0-in-position-20) that could be useful for you! – ericcco Oct 18 '19 at 10:59
  • Ascii does not support Chinese. You to use Unicode (utf-8). – John Hanley Oct 18 '19 at 14:20

0 Answers0