字串編碼

First look at this:

s = 'a str'

s is a str object. Charset of s is default by computer(ex:big5 or ascii).
Convert s to unicode string, do this:
u = s.decode()#u is a uncidoe string from s
#or
u = unicode(s).

Our computer's default charset is big5 but google's computer is ascii.
So you need to specify charset like this: unicode(s, 'big5') or s.decode('big5').
When you want convert to back bytestring(str),you can do it:
u = unicode('unicode string')
s = u.encode('big5')#s is a bytestring from u
str( u)#convert u in default charset

You may confuse about encode and decode.
Because of 'encode' is encode Unicode string to byte string and 'decode' is decode byte string to unicode string in python.