The encoder uses the standard alphabet of letters, digits, plus, and slash, with equals signs for padding, as described in RFC 4648. The input is UTF-8, not a file upload.
The decoder rejects characters outside that alphabet and rejects a length that is not a multiple of four. URL-safe Base64, which uses minus and underscore, is not accepted here.