mirror of
https://github.com/zxing/zxing.git
synced 2025-02-21 02:55:27 -08:00
URL-decode email address in mailto: link
git-svn-id: https://zxing.googlecode.com/svn/trunk@2573 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
62bd9719a8
commit
3b9b63da18
|
@ -39,6 +39,7 @@ public final class EmailAddressResultParser extends ResultParser {
|
|||
if (queryStart >= 0) {
|
||||
emailAddress = emailAddress.substring(0, queryStart);
|
||||
}
|
||||
emailAddress = urlDecode(emailAddress);
|
||||
Map<String,String> nameValues = parseNameValuePairs(rawText);
|
||||
String subject = null;
|
||||
String body = null;
|
||||
|
|
|
@ -184,15 +184,21 @@ public abstract class ResultParser {
|
|||
String key = keyValueTokens[0];
|
||||
String value = keyValueTokens[1];
|
||||
try {
|
||||
value = URLDecoder.decode(value, "UTF-8");
|
||||
value = urlDecode(value);
|
||||
result.put(key, value);
|
||||
} catch (UnsupportedEncodingException uee) {
|
||||
throw new IllegalStateException(uee); // can't happen
|
||||
} catch (IllegalArgumentException iae) {
|
||||
// continue; invalid data such as an escape like %0t
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static String urlDecode(String encoded) {
|
||||
try {
|
||||
return URLDecoder.decode(encoded, "UTF-8");
|
||||
} catch (UnsupportedEncodingException uee) {
|
||||
throw new IllegalStateException(uee); // can't happen
|
||||
}
|
||||
}
|
||||
|
||||
static String[] matchPrefixedField(String prefix, String rawText, char endChar, boolean trim) {
|
||||
List<String> matches = null;
|
||||
|
|
Loading…
Reference in a new issue