예제 #1
0
파일: parsing.py 프로젝트: j-howell/calibre
 def __call__(self, container):
     raw = container.raw_data(self.name)
     if isinstance(raw, type('')):
         raw, changed = replace_encoding_declarations(raw)
         if changed:
             container.open(self.name, 'wb').write(raw.encode('utf-8'))
             return True
예제 #2
0
파일: parsing.py 프로젝트: greising/calibre
 def __call__(self, container):
     raw = container.raw_data(self.name)
     if isinstance(raw, type('')):
         raw, changed = replace_encoding_declarations(raw)
         if changed:
             container.open(self.name, 'wb').write(raw.encode('utf-8'))
             return True
예제 #3
0
파일: widget.py 프로젝트: elonchen/calibre
 def data(self):
     ans = self.get_raw_data()
     ans, changed = replace_encoding_declarations(ans,
                                                  enc='utf-8',
                                                  limit=4 * 1024)
     if changed:
         self.data = ans
     return ans.encode('utf-8')
예제 #4
0
파일: widget.py 프로젝트: davidfor/calibre
 def fget(self):
     ans = self.get_raw_data()
     ans, changed = replace_encoding_declarations(ans, enc='utf-8', limit=4*1024)
     if changed:
         self.data = ans
     return ans.encode('utf-8')