!!binary (tag:yaml.org,2002:binary) fails to parse base64 formatted data as defined by RFC2045 (MIME)

Issue #349 resolved
Former user created an issue

Snakeyaml 1.17 will fail to parse base64 formatted data as defined by RFC2045 (MIME) when explicitly type tagged with !!binary (tag:yaml.org,2002:binary) as defined in http://yaml.org/type/binary.html

From "Example 2.23. Various Explicit Tags" from spec (1.1 and 1.2)

---
picture: !!binary |
 R0lGODlhDAAMAIQAAP//9/X
 17unp5WZmZgAAAOfn515eXv
 Pz7Y6OjuDg4J+fn5OTk6enp
 56enmleECcgggoBADs=

java.lang.IllegalArgumentException: Illegal character in Base64 encoded data.

I note that snakeyaml is managing its own Base64 encoder/decoder. JRE now provides java.util.Base64 but requires java 8, which I don't think is unreasonable as Java 7 has been EOF for over 1.5 years.

Comments (4)

  1. Former user Account Deleted reporter

    Nope, that just says that if I remove the line breaks it works - I knew that, and sure its a work around for this bug, but snakeyaml does not conform to the yaml spec.

  2. Log in to comment