You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mime4j-dev@james.apache.org by "Tellier Benoit (JIRA)" <mi...@james.apache.org> on 2018/05/22 09:04:00 UTC

[jira] [Closed] (MIME4J-263) DecoderUtil.decodeEncodedWords() doesn't decode an encoded empty string

     [ https://issues.apache.org/jira/browse/MIME4J-263?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tellier Benoit closed MIME4J-263.
---------------------------------

> DecoderUtil.decodeEncodedWords() doesn't decode an encoded empty string
> -----------------------------------------------------------------------
>
>                 Key: MIME4J-263
>                 URL: https://issues.apache.org/jira/browse/MIME4J-263
>             Project: James Mime4j
>          Issue Type: Bug
>          Components: parser (core)
>            Reporter: Artur Jablonski
>            Priority: Minor
>
> {{DecoderUtil.decodeEncodedWords()}} returns an unencoded string if the word to decode is empty.
> For example
> {{DecoderUtil.decodeEncodedWords("=?utf-8?Q??=", DecodeMonitor.SILENT)}}
> returns
> {{"=?utf-8?Q??="}}
> instead of empty string (or perhaps null)
> The problem lies in the regexp that is used behind the scenes that requires at least one character:
> {code}
> private static final Pattern PATTERN_ENCODED_WORD = Pattern.compile(
>             "(.*?)=\\?(.+?)\\?(\\w)\\?(.+?)\\?=", Pattern.DOTALL);
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)