update with @mdawaffe's new length_ucs2, revert loop to original (should be faster this way)
https://gist.github.com/mdawaffe/7ef89f078f97d92e300b