First pass string encoding