small performance improv in stri_encode