diff --git a/Core/Source/DTHTMLAttributedStringBuilder.m b/Core/Source/DTHTMLAttributedStringBuilder.m
index b58127e0c..8bf17ae4c 100644
--- a/Core/Source/DTHTMLAttributedStringBuilder.m
+++ b/Core/Source/DTHTMLAttributedStringBuilder.m
@@ -8,6 +8,7 @@
#import
#import
+#import
#import "DTHTMLAttributedStringBuilder.h"
@@ -421,7 +422,7 @@ - (void)_registerTagStartHandlers
NSURL *link = [NSURL URLWithString:cleanString];
if (link == nil) {
- link = [NSURL URLWithString:[cleanString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
+ link = [NSURL URLWithString:[cleanString stringByURLEncoding]];
}
// deal with relative URL