Last active
March 8, 2021 15:21
-
-
Save markvanwijnen/8a8a240d2ec753373969b2bb462b4aa9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension CharacterSet { | |
static var urlRFC3986Allowed: CharacterSet { | |
CharacterSet(charactersIn: "-_.~").union(.alphanumerics) | |
} | |
} | |
extension String { | |
var oAuthURLEncodedString: String { | |
self.addingPercentEncoding(withAllowedCharacters: .urlRFC3986Allowed) ?? self | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment