If you back up a database from one version of postgres using pg_dumpall, then restore to another version, it's very possible that the strictness or some other aspect of the UTF8 library has changed. The end result is that you will see an error "invalid character for encoding" while restoring.
UTF8 Encoding and Postgres Dump
UTF8 Encoding and Postgres Dump
UTF8 Encoding and Postgres Dump
If you back up a database from one version of postgres using pg_dumpall, then restore to another version, it's very possible that the strictness or some other aspect of the UTF8 library has changed. The end result is that you will see an error "invalid character for encoding" while restoring.