NEXUS-6622: Backport from master

Original PR
https://github.com/sonatype/nexus-oss/pull/554
Merge pull request #558 from sonatype/nexus-2.9.x-NEXUS-6622-unknown-charset

[2.9] Backport of NEXUS-6622 Unknown charset