def METHOD_NAME(data, prm, req):
    """ Encode a raw bounding box."""
    content_type = "text/plain" if req.mime_type is None else req.mime_type
    content_type = "%s; charset=utf-8"%content_type
    try:
        encoded_data = prm.encode_kvp(data).encode('utf-8')
    except (ValueError, TypeError) as exc:
        raise InvalidOutputValueError(prm.identifier, exc)
    return ResultAlt(
        encoded_data, identifier=prm.identifier,
        content_type="text/plain" if req.mime_type is None else req.mime_type
    )