下面的事情真的让我很烦恼,我笔记本电脑上的 python 版本和 Docker 的 ubuntu:trusty 图像中的 python 版本使用它们的编解码器打印不同的结果,这是什么原因?例如,我笔记本电脑上的 python3(ubuntu,trusty):
Python 3.4.3 (default, Apr 14 2015, 14:16:55)
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import codecs
>>> codecs.decode(b'\xe2\x80\x99','utf8')
'’'
>>>
Docker ubuntu 上的 python3:最新:
Python 3.4.0 (default, Apr 11 2014, 13:05:11)
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import codecs
>>> codecs.decode(b'\xe2\x80\x99','utf8')
'\u2019'
>>>
我可以在 Docker 的 ubuntu 上制作 python3 编解码器:trusty decode b'\xe2\x80\x99' as '''?