UPDATE: stri_split_pos st=i-1 replaced with lasti. i-1 works well when you copy one-byte char. For two-byte like "ą" there should be i-2.additional variable lasti solves this problem.