Skip to content

Commit

Permalink
[clangd] Do not precent-encode numbers in URI.
Browse files Browse the repository at this point in the history
Reviewers: ilya-biryukov

Subscribers: klimek, jkorous-apple, cfe-commits, sammccall

Differential Revision: https://reviews.llvm.org/D43009

llvm-svn: 324475
  • Loading branch information
Eric Liu committed Feb 7, 2018
1 parent 524bd9c commit 7deda4f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion clang-tools-extra/clangd/URI.cpp
Expand Up @@ -79,7 +79,8 @@ findSchemeByName(llvm::StringRef Scheme) {

bool shouldEscape(unsigned char C) {
// Unreserved characters.
if ((C >= 'a' && C <= 'z') || (C >= 'A' && C <= 'Z'))
if ((C >= 'a' && C <= 'z') || (C >= 'A' && C <= 'Z') ||
(C >= '0' && C <= '9'))
return false;
switch (C) {
case '-':
Expand Down
1 change: 1 addition & 0 deletions clang-tools-extra/unittests/clangd/URITests.cpp
Expand Up @@ -72,6 +72,7 @@ URI parseOrDie(llvm::StringRef Uri) {
TEST(PercentEncodingTest, Encode) {
EXPECT_EQ(URI("x", /*Authority=*/"", "a/b/c").toString(), "x:a/b/c");
EXPECT_EQ(URI("x", /*Authority=*/"", "a!b;c~").toString(), "x:a%21b%3bc~");
EXPECT_EQ(URI("x", /*Authority=*/"", "a123b").toString(), "x:a123b");
}

TEST(PercentEncodingTest, Decode) {
Expand Down

0 comments on commit 7deda4f

Please sign in to comment.