Dear Community,
The Substr function fails whenever the string contains emojis. Has anyone found a solution for it?
Hi Ron,
Please expand on how the Substr built-in function fails. What's the output?
Also, provide the parameters you're using.
The widget in which the Substr is part of the expression (assignment in my case) throw an exeption and the sting ins't copied at all.
Alright, again, please provide more context. Share the exception thrown and the Substr parameters if possible.
substr("❤️Outsystems👿Substr😳",1,10) throw an exception.
Desired result: "Outsystems"
I tried in a reactive app and i have no problem with it.
Can you share an oml of what exactly you are doing and see if the problem is with mobile vs reactive ?
(I can't check, not near a computer now)
I'm attaching an OAP that demonstrate the issue
Please see the attached OAP that demostrate the issue
Hi @Ron Ben
i checked your OAP and its working fine.
just try to do this
attaching the oap.
Regards,
Prince
I would suggest you to read the following article. It explains in-depth what the underlying encoding of emojis is, and hence you can understand the problems with using Substr on multi-byte characters (like emojis).
I understand the issue and the differences between length in terms of chars and length in terms of bytes. My question was regsrding a way of counting/extracting the bytes of a string rather of the chars like length/substr?