> assertEquals("Test ü and more", DecoderUtil.decodeEncodedWords("Test
> =?ISO-8859-1?Q?=FC_?= =?ISO-8859-1?Q?and_more?="));

Coincidentally the same problem has been reported yesterday by Wim
Jongman. Funny how bugs like this can somehow remain undetected for
years and then show up all of a sudden..

This then qualifies as a Schroedinbug: 
http://catb.org/~esr/jargon/html/S/schroedinbug.html

> After this fix there is only one space between "ü" and "and", which I think
> is not correct (but I'm not sure).

No I think one space would be correct, see MIME4J-104.

My bad! Sorry.

> Proposed Solution:
>
> Replace "indexOf" by Regex matching, like so:
> [...]

I'm afraid that would reintroduce MIME4J-104..


If you are interested I could write a regex based version which will not reintroduce the double space bug. I'ld use the regex to extract charset, encoding and encoded string in one go. I think it will be at least as fast as the current method. However, java.util.regex requires Java 1.4, if that's a no-go I won't bother.
Thanks for your quick response.

Reply via email to