I am creating some files using Python, with unicode text, and saving the content in sqlite3 DB. Later, I fetch these files and make some changes. Problem is that Python doesn't think these two strings are the same, even though they look the same.
Here's an example:
Str1 : "Copa América 2019"
Str2 : "Copa América 2019"
While both the strings look exactly the same, the program doesn't treat them the same.
I'm seeing the same behavior in other languages as well (Korean, Japanese etc.), and chose French example here as it's easier to read for me. Korean / Japanese I matched the characters by how they look.
I also did the comparisons online (for ex. https://www.quickdiff.com/) and found the same result... so it's not Python specific but some other issue.
What operation can I do on the strings so the code sees these two strings as same?
Tried explicit conversions to str / utf-8 encoding individually but none of it helped.
a = "Copa América 2019"
b = "Copa América 2019"
if a == b:
print 'y'
type(a)
<type 'str'>
type(b)
<type 'str'>
I would like the String comparison for these strings to result in True.