The Java 8 Base64 library has two variants that can be used in URI building: the \"Basic\" one and the \"URL and Filename safe\". The documentation points to RFC 4648 Table 2 as
Running some tests, encoding a data URI using base64 "URL and filename safe" produces URIs that are not recognised by Chrome.
Example: data:text/plain;base64,TG9yZW0/aXBzdW0=
is properly decoded to Lorem?ipsum
, while its URL-safe counterpart data:text/plain;base64,TG9yZW0_aXBzdW0=
is not (ERR_INVALID_URL).