>>> "—".replace("—", "\u10EAD\u10EAC")
'ცDცC'
Behold indeed.I didn't expect ChatGPT to make such trivial mistake, although, I have no idea which model do they use on the free plan these days.
The correct code is, of course:
text.replace("—", "\U00010EAD\U00010EAC")
...in case anyone is curious. def replace_em_dash(text: str) -> str:
"""
+-------------------+
| ( ͡° ͜ʖ ͡° ) |
+-------------------+
"""
return text.replace("—", "\U00010EAD\U00010EAC")