获取能正确解码的文件字符串
(self, toscans: list)
| 225 | return __lu__().format_cmd(tool_path, args) |
| 226 | |
| 227 | def get_valid_encode_files(self, toscans: list): |
| 228 | """ |
| 229 | 获取能正确解码的文件字符串 |
| 230 | """ |
| 231 | new_toscans = [] |
| 232 | for path in toscans: |
| 233 | try: |
| 234 | path.encode(encoding="UTF-8") |
| 235 | except UnicodeEncodeError: |
| 236 | logger.info("ignore file: %s" % path) |
| 237 | continue |
| 238 | new_toscans.append(path) |
| 239 | return new_toscans |
| 240 | |
| 241 | def set_filter_type_list(self): |
| 242 | ''' |