Fix sort_pos: it should return -1,0,1 instead of boolean
spec: specify scriptencoding
Merge branch 'fix-appveyor' into dev, also fix sort_pos func