Python代码片段-二维List转换utf8编码
记录自己零星的代码片段,方便以后查阅
#python2.7
def is_unicode_char (char):
return isinstance(char, unicode)
# transform every element in a 2d list to utf-8
# parameters: @list_2d : a 2d list
# return a new 2d list with all elements coding in utf-8
def list_2d_encode_utf8(list_2d):
result_list = []
for row in list_2d:
temp = []