!!binary (tag:yaml.org,2002:binary) fails to parse base64 formatted data as defined by RFC2045 (MIME)
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)
-
-
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.
-
- changed status to open
-
- changed status to resolved
Fixed in the latest snapshot - https://oss.sonatype.org/content/repositories/snapshots/org/yaml/snakeyaml/
- Log in to comment
I think you may find some answers by reading https://code.google.com/archive/p/snakeyaml/issues/99