Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Character-to-byte unicode strings index conversion
#2
I cannot offer a smarter way.

Replace
j=s5.len - 1
to
j=s5.len

Function iniuni
Code:
Copy      Help
;/
function# $s i

;s - unicode string
;i - unicode character index

if i > 0
,str s3
,s3.unicode(s)
,i*2
,if(i>s3.len) i=s3.len
,s3.fix(i)
,s3.ansi
,ret s3.len


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)