Tech C**P
14 subscribers
161 photos
9 videos
59 files
304 links
مدرس و برنامه نویس پایتون و لینوکس @alirezastack
Download Telegram
If you are working in docker and have utf8 problems like UnicodeDecodeError exceptions. And you are scratching your head like me and encode & decode does no good for the problem, use setdefaultencoding:

import sys
reload(sys)
sys.setdefaultencoding("utf-8")

NOTE: it is discouraged to use the above function. As I have mentioned docker which its OS is isolated, I aware of what I'm doing. In case you are in doubt DO NOT USE IT specially on host OS!

#python #encoding #utf8 #encode #decode