Created
January 26, 2018 09:22
-
-
Save linzino7/fd04ac8bbc012aa6c0c9acd802bdd694 to your computer and use it in GitHub Desktop.
Python3 bytes.decode() 當遇到字串一樣時python 判別
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Created on Fri Jan 19 17:34:34 2018 | |
當遇到字串一樣時python 判別 | |
@author: zino | |
""" | |
a="如何找資料或向誰請教" | |
a.encode('utf-8') | |
b="如何找資料或向誰請教" | |
b.encode('utf-8') | |
c='\xe6\x96\x99' | |
c.encode('utf-8') | |
c.decode('UTF-8','strict') | |
c=b'\xe6\x96\x99' | |
c.decode('UTF-8','strict') | |
d=b'\xef\xa6\xbe' | |
d.decode('UTF-8','strict') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment