From cdc4a7b7a43ba6909acf0519b64918f8e2a30759 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20D=E2=80=98Aquino?= Date: Thu, 3 Aug 2023 03:38:56 +0000 Subject: [PATCH] Fix UTF support for hashtags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changelog-Fixed: Fix UTF support for hashtags Closes: https://github.com/damus-io/damus/issues/1411 Signed-off-by: Daniel D‘Aquino Signed-off-by: William Casarin --- damus/Util/Hashtags.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/damus/Util/Hashtags.swift b/damus/Util/Hashtags.swift index be13b131..eabe5312 100644 --- a/damus/Util/Hashtags.swift +++ b/damus/Util/Hashtags.swift @@ -42,7 +42,7 @@ let custom_hashtags: [String: CustomHashtag] = [ func hashtag_str(_ htag: String) -> CompatibleText { var attributedString = AttributedString(stringLiteral: "#\(htag)") - attributedString.link = URL(string: "damus:t:\(htag)") + attributedString.link = URL(string: "damus:t:\(htag.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed) ?? htag)") let lowertag = htag.lowercased()