08-05-2021, 02:40 PM
a couple more options
#1 you can use this member function
Member function str.getU2
for your example would use like so
Function UnicodeTest1
#2 can use paste with format fields
Function UnicodeTest2
#1 you can use this member function
Member function str.getU2
function$ $sinp from nc
;Unicode version of "get" macro, it also serves left
;Error if from invalid.
;If nc < 0 or too big, gets all right part.
str s.unicode(sinp) ;;convert to UTF-16
from*2; nc*2
if(from<0 or from>s.len) end ERR_BADARG
if(nc<0 or from+nc>s.len) nc=s.len-from
this.ansi(s+from -1 nc/2)
ret this
Function UnicodeTest1
str s.getclip;
paste s
str b.getU2(s 0 1);; gets first character
paste b
#ret;;for testing place cursor on line below and run
#2 can use paste with format fields
Function UnicodeTest2