Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to deal with unicode in strings?
#2
QM string encoding is UTF8. It means variable-length characters. Some characters are 1 byte, some 2, 3 or 4 (rarely).
When you know character length, simply use it in code.

Macro Macro3017
Code:
Copy      Help
str s="ąbc" ;;first character is 2 bytes
str bad.left(s 1) ;;gets half of character
out bad
str good.left(s 2)
out good

In other cases usually you use find or findrx or similar function to find a substring, and it gives correct result.


Messages In This Thread
How to deal with unicode in strings? - by MBaas - 08-04-2021, 08:08 AM
RE: How to deal with unicode in strings? - by Gintaras - 08-04-2021, 06:39 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)