I have a rather annoying issue that I solved using a simple recursive method in Java. However, I'm looking for a better way to do this.
The initial problem involved the presence of whitespace within a Quoted Printable/Base64 encoded Mime header - which as I read the RFC 2047 specification - isn't allowed. This means that decoding fails for a MIME header when whitespace is present, e.g.
=?iso-8859-1?Q?H=E4 ll and nothing?=
or more pertinently:
=?iso-8859-1?Q?H=E4 ll?= preserve this text =?iso-8859-1?Q?mo nk ey?=
The goal is to only remove the whitespace between the =? ?= boundaries (or re-encode using =20). Other text outside this should be preserved.
I'm looking for alternative approaches to solving this my target language for this is Java. Any ideas on the simplest, cleanest approach to this?