I am taking a string from a php 7 program, and processing it in Python 3.7.2.
my_str = 'ü'
print(type(my_str))
str_list = list(my_str)
for letter in str_list:
print('letter',letter)
if 'ü' in my_str:
print('we have the umlaut')
else:
print('we have no umlaut')
Here is the output:
<class 'str'>
letter u
letter ̈
we have no umlaut
Why is the letter u separate from the umlaut? If I type a ü in this string, it is read as 'ü', and the test for 'ü' succeeds. How can I correct this string, so it has a ü and not two separate characters?
Thanks in advance for any tips. I have searched for this and found nothing helpful.