Python亂碼、編碼
三種編碼之間可以通過unicode進行轉化,內部默認存儲爲unicode格式
unicode爲中介
一般使用uft-8
gbk一般顯示爲亂碼
str.decode('utf-8').encode('gbk')
str.decode('gbk').encode('utf-8')
unicode可以顯示在hive表中
str.decode('utf-8')得到unicode格式的字符串
參考文獻:
https://blog.csdn.net/chixujohnny/article/details/51782826