fork download
  1. import re
  2. key = "df"
  3. value = "TH"
  4. line = "df,äg"
  5. line = re.sub(ur'%s,' % key, ur'%s,' % value, line.decode('utf-8'), flags=re.UNICODE).encode("utf8")
  6. print(line)
Success #stdin #stdout 0.01s 8968KB
stdin
Standard input is empty
stdout
TH,äg