looks like a classic case of mojibake -- in this case it's interpreted using latin1 when it should be UTF-8:
>>> "Al BaÅ£á ̧©ah".encode('latin1')
b'Al Ba\xc5\xa3\xe1\xb8\xa9ah'
>>> "Al BaÅ£á ̧©ah".encode('latin1').decode('UTF-8')
'Al Baţḩah'
Code for those that want to copy/paste into a program instead of command line:
source_text = "Al BaÅ£á ̧©ah"
print("source_text=", source_text)
encoded_source_text = source_text.encode('latin1')
decoded_text = encoded_source_text.decode("utf"'UTF-8')
print("decoded_text=", decoded_text)
looks like a classic case of mojibake -- in this case it's interpreted using latin1 when it should be UTF-8:
>>> "Al BaÅ£á ̧©ah".encode('latin1')
b'Al Ba\xc5\xa3\xe1\xb8\xa9ah'
>>> "Al BaÅ£á ̧©ah".encode('latin1').decode('UTF-8')
'Al Baţḩah'
Code for those that want to copy/paste into a program instead of command line:
source_text = "Al BaÅ£á ̧©ah"
print("source_text=", source_text)
encoded_source_text = source_text.encode('latin1')
decoded_text = encoded_source_text.decode("utf")
print("decoded_text=", decoded_text)
looks like a classic case of mojibake -- in this case it's interpreted using latin1 when it should be UTF-8:
>>> "Al BaÅ£á ̧©ah".encode('latin1')
b'Al Ba\xc5\xa3\xe1\xb8\xa9ah'
>>> "Al BaÅ£á ̧©ah".encode('latin1').decode('UTF-8')
'Al Baţḩah'
Code for those that want to copy/paste into a program instead of command line:
source_text = "Al BaÅ£á ̧©ah"
print("source_text=", source_text)
encoded_source_text = source_text.encode('latin1')
decoded_text = encoded_source_text.decode('UTF-8')
print("decoded_text=", decoded_text)
- 18.5k
- 48
- 165
- 285
looks like a classic case of mojibake -- in this case it's interpreted using latin1 when it should be UTF-8:
>>> "Al BaÅ£á ̧©ah".encode('latin1')
b'Al Ba\xc5\xa3\xe1\xb8\xa9ah'
>>> "Al BaÅ£á ̧©ah".encode('latin1').decode('UTF-8')
'Al Baţḩah'
Code for those that want to copy/paste into a program instead of command line:
source_text = "Al BaÅ£á ̧©ah"
print("source_text=", source_text)
encoded_source_text = source_text.encode('latin1')
decoded_text = encoded_source_text.decode("utf")
print("decoded_text=", decoded_text)
looks like a classic case of mojibake -- in this case it's interpreted using latin1 when it should be UTF-8:
>>> "Al BaÅ£á ̧©ah".encode('latin1')
b'Al Ba\xc5\xa3\xe1\xb8\xa9ah'
>>> "Al BaÅ£á ̧©ah".encode('latin1').decode('UTF-8')
'Al Baţḩah'
looks like a classic case of mojibake -- in this case it's interpreted using latin1 when it should be UTF-8:
>>> "Al BaÅ£á ̧©ah".encode('latin1')
b'Al Ba\xc5\xa3\xe1\xb8\xa9ah'
>>> "Al BaÅ£á ̧©ah".encode('latin1').decode('UTF-8')
'Al Baţḩah'
Code for those that want to copy/paste into a program instead of command line:
source_text = "Al BaÅ£á ̧©ah"
print("source_text=", source_text)
encoded_source_text = source_text.encode('latin1')
decoded_text = encoded_source_text.decode("utf")
print("decoded_text=", decoded_text)
looks like a classic case of mojibake -- in this case it's interpreted using latin1 when it should be UTF-8:
>>> "Al BaÅ£á ̧©ah".encode('latin1')
b'Al Ba\xc5\xa3\xe1\xb8\xa9ah'
>>> "Al BaÅ£á ̧©ah".encode('latin1').decode('UTF-8')
'Al Baţḩah'