Fix fix_encoding on frozen string

This PR solves 2 problems:

* Replace fix_encoding with fix_encoding! to mark the fact that it is a potentially destructive operation
* Use fix_encoding on a dup of a frozen string if needed