Skip to content

Conversation

@swhiteman
Copy link

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

};

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