def decode(self, input, final=False):
return codecs.latin_1_decode(input,self.errors)[0]
python类latin_1_decode()的实例源码
def name2cp(k):
if k == 'apos': return ord("'")
if hasattr(htmlentitydefs, "name2codepoint"): # requires Python 2.3
return htmlentitydefs.name2codepoint[k]
else:
k = htmlentitydefs.entitydefs[k]
if k.startswith("&#") and k.endswith(";"): return int(k[2:-1]) # not in latin-1
return ord(codecs.latin_1_decode(k)[0])
def decode(self, input, final=False):
return codecs.latin_1_decode(input,self.errors)[0]
def decode(self, input, final=False):
return codecs.latin_1_decode(input,self.errors)[0]
def decode(self, input, final=False):
return codecs.latin_1_decode(input,self.errors)[0]
def decode(self, input, final=False):
return codecs.latin_1_decode(input,self.errors)[0]
def decode(self, input, final=False):
return codecs.latin_1_decode(input,self.errors)[0]
def decode(self, input, final=False):
return codecs.latin_1_decode(input,self.errors)[0]
def decode(self, input, final=False):
return codecs.latin_1_decode(input,self.errors)[0]
def decode(self, input, final=False):
return codecs.latin_1_decode(input,self.errors)[0]
def decode(self, input, final=False):
return codecs.latin_1_decode(input,self.errors)[0]
def decode(self, input, final=False):
return codecs.latin_1_decode(input,self.errors)[0]
def decode(self, input, final=False):
return codecs.latin_1_decode(input,self.errors)[0]
def decode(self, input, final=False):
return codecs.latin_1_decode(input,self.errors)[0]
def decode(self, input, final=False):
return codecs.latin_1_decode(input,self.errors)[0]
def decode(self, input, final=False):
return codecs.latin_1_decode(input,self.errors)[0]
def decode(self, input, final=False):
return codecs.latin_1_decode(input,self.errors)[0]
def name2cp(k):
if k == 'apos': return ord("'")
if hasattr(htmlentitydefs, "name2codepoint"): # requires Python 2.3
return htmlentitydefs.name2codepoint[k]
else:
k = htmlentitydefs.entitydefs[k]
if k.startswith("&#") and k.endswith(";"): return int(k[2:-1]) # not in latin-1
return ord(codecs.latin_1_decode(k)[0])
def decode(self, input, final=False):
return codecs.latin_1_decode(input,self.errors)[0]
def decode(self, input, final=False):
return codecs.latin_1_decode(input,self.errors)[0]