Hello i am using python 3.4
I am trying to read a SQL-file (test2.sql)
and write each line to another file (test1.sql), replacing all occurrences of a string.
The code i have below works fine when writing to .txt-files, but when trying to write to .sql-files strange Chinese characters trail each line
import fileinput
import sys
g = open('test1.sql', mode='w')
with fileinput.input(files=("test2.sql")) as f:
for line in f:
g.write(line.replace("database1","database2"))