Setup string attributes in correct order

This prevents an uninitialized memory read because encoding setup checks
ascii_only and valid_encoding state.