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

FAQ: Clarify Windows double quote usage #8823

Closed
wants to merge 1 commit into from

Conversation

jay
Copy link
Member

@jay jay commented May 9, 2022

  • Windows command prompt doesn't use literal quoting via single quotes.

  • Windows command prompt inner double quotes are escaped with a
    backslash.

  • Windows powershell does use single quotes but curl is not a powershell
    script so the arguments may not be passed on correctly.

  • Windows powershell inner double quotes seems can be passed to curl if
    the outer quotes are double quotes and an escape of backslash-backtick
    is used.

Command prompt example:

getargs -v -d "\"a\""

argv[0]: getargs
argv[1]: -v
argv[2]: -d
argv[3]: "a"

Ref: #8818

Reported-by: KotlinIsland@users.noreply.github.com

Closes #xxxx

- Windows command prompt doesn't use literal quoting via single quotes.

- Windows command prompt inner double quotes are escaped with a
  backslash.

- Windows powershell does use single quotes but curl is not a powershell
  script so the arguments may not be passed on correctly.

- Windows powershell inner double quotes seems can be passed to curl if
  the outer quotes are double quotes and an escape of backslash-backtick
  is used.

Command prompt example:

~~~
getargs -v -d "\"a\""

argv[0]: getargs
argv[1]: -v
argv[2]: -d
argv[3]: "a"
~~~

Ref: curl#8818

Reported-by: KotlinIsland@users.noreply.github.com

Closes #xxxx
@jay jay force-pushed the faq_win_dbl_quote branch from 004e121 to ab611b6 Compare May 9, 2022 06:33
For Windows powershell the arguments are not always passed on as expected
because curl is not a powershell script. You may or may not be able to use
single quotes. To escape inner double quotes seems to require a
backslash-backtick escape sequence and the outer quotes as double quotes.
Copy link
Member

Choose a reason for hiding this comment

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

Does this warrant a small example, or is that overkill?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it's overkill. It's already a stretch to explain that inner double quotes need escaping.

@jay jay closed this in a61eac6 May 14, 2022
@jay jay deleted the faq_win_dbl_quote branch May 14, 2022 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants