Solve non_empty problem; check empty strings too!

- Added tests for empty strings as well
- Ensure that the test can always produce strings in the desired
  encoding
- Optimize for happy path of ascii-compatible encodings