Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix literal underscore encoding #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

swhiteman
Copy link

Literal underscore needs to be encoded as =5F or else the encoded product is ambiguous. #4

@@ -34,7 +34,7 @@
});
};

var regexUnsafeSymbols = /[\0-\x1F"-\),\.:-@\[-\^`\{-\uFFFF]/g;
var regexUnsafeSymbols = /[\0-\x1F"-\),\.:-@\[-_`\{-\uFFFF]/g;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to remove \^?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me re-review.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally getting back to this. Yes, that was deliberate!

It isn't actually removing the caret ^ because you had the character range [ through ^ (U+005B to U+005E) and by substituting the _ (U+005F) the range is now U+005B to U+005F, still including U+005E.

Of course the character range

\[-_

could be further simplified to

\[-`

(U+005B to U+0060, inclusive) but was trying to be unintrusive.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking in on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants