Python2.7 Kullananlar için
# -*- coding: utf-8 -*-
import os
import re
import codecs
def read_file_with_fallback(file_path):
encodings = ['utf-8', 'latin-1', 'cp1252']
for enc in encodings:
try:
with codecs.open(file_path, 'r', encoding=enc) as file...