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

Support "Curly Quotes" for Args.quoted #1545

Closed
dfontana opened this issue Oct 12, 2021 · 3 comments · Fixed by #1553
Closed

Support "Curly Quotes" for Args.quoted #1545

dfontana opened this issue Oct 12, 2021 · 3 comments · Fixed by #1553
Labels
feature-request A new requested functionality. framework Related to the `framework` and `framework::standard` modules and/or the `command_attr` crate

Comments

@dfontana
Copy link

Overview

Users on Mavericks+ Apple platforms (eg iOS) by default have their quote keys input "Curly Quotes" rather than straight quotes (also known as "Smart Quotes" or "Smart Punctuation"). This causes arguments to fail parsing, as it appears lexing checks against straight quotes only. While users could be asked to change their defaults, it's an abrasive experience that they may not wish to endeavor; and - at least on iOS - is a global setting they may not wish to change for this one use case.

Details

These Curly quotes appear to be unicode characters 201C and 201D.

Potential Solves

  • Bot owners could check themselves, and alert the user -- kinda like the rust compiler. This won't be very graceful, however, and would probably introduce some complexity around argument count validation when using the macros.
  • Args could be standardized to replace various known quote shapes with their straight line forms before passed into lexing, but this may have unintended consequences.
  • The lexer function (linked earlier) could check for multiple quote styles; the major downsides being if these quotes were intermixed it could be tricky to get right. It might be fair to assume the two types would not be mixed (as so: "The “lazy” fox") or perhaps the first quote encountered can govern the style for the remainder of lexing.

Thoughts? I stumbled upon this in a guild with some friends, some of which use iPhone and others Android; some of whom are very not technical and it took some explaining to rectify what happened. But it's an annoying experience.

@arqunis arqunis added feature-request A new requested functionality. framework Related to the `framework` and `framework::standard` modules and/or the `command_attr` crate labels Oct 15, 2021
@arqunis
Copy link
Member

arqunis commented Oct 16, 2021

I have opened #1553, which I have implemented per your third solution. Could you try it yourself if it works for your users? I have tested it myself by manually copying (I don't own an Apple device) the curly quote characters into an argument, which with my PR work the same as ".

@dfontana
Copy link
Author

Oh awesome! I will gladly get this booted and test it, will report back

@dfontana
Copy link
Author

Happy to report your branch does the trick 🎉 I was able to test on my iPad which has smart quotes, see image below inside the spoiler 😄 Thank you for this!

Image of Both QuotesWork

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A new requested functionality. framework Related to the `framework` and `framework::standard` modules and/or the `command_attr` crate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants