The following issue occurs when returning Sinhala sentences with \u200d joiner.
def test_function():
return 'ෆ්රෙන්ස්!' #frens
test_function()
The output is returned as 'ෆ්\u200dරෙන්ස්!'(=f\u200drens) not 'ෆ්රෙන්ස්!'(=frens!). This issue does not exist when printing to the terminal or writing to a file. But occurs when assigned to a variable.
I tried encode().decode(), unicodedata.normalize which does not resolve the issue. The closest I could get was Printing family emoji, with U+200D zero-width joiner, directly, vs via list where I realised that the issue is possibly due to the \u200d joiner.
Note: The code was tested on Colab.
Thank you so much in advance.