Allow specifying a custom charset for a multipart Attribute

- Fixed #2025
- Adapted from @BabyDuncan's pull request: #2031
- Overall ugliness clean-up