after adding about 6k of lines into my mySQL database through Python, some letters are wrong ( polish letters), like Å‚ for ł and ż for ż and others. How can I repair that? My python code is:
# -*- coding: utf-8 -*-
import MySQLdb
import string
import codecs
file = codecs.open("----", 'r', 'utf-8')
db = MySQLdb.connect(host="-----", port=3306, user="-----", passwd="------", db="----")
cursor = db.cursor()
for line in file:
lines = string.replace(line, "'", '"')
cursor.execute("INSERT INTO Logs (Text) VALUE ('%s')"% lines.encode("utf-8"))
db.close()
print("done")
and after running this code, it works normally , but in PhpMyAdmin, there is wrong letters. Coding in Database is UTF-8, file is in ANSI as UTF-8 (from notepad++). Any Help?