So I would just check for UTF-8 and treat everything else as binary that has to be encoded in Base64.