string = "000000ⁿ0000"
string.replace('ⁿ', "-")
string.replace('\u207f', "-")
print(string)
Error:
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u207f' in position 6: character maps to <undefined>
Explicitly specifying utf-8 didn't help
replace returns what you want, there is no side effect.
string = "000000ⁿ0000"
ok = string.replace('ⁿ','-')
print(string)
#000000ⁿ0000
print(ok)
#000000-0000