Powershell: unsupported quote character \x{201F}

Created on 30 Apr 2019  Â·  4Comments  Â·  Source: PowerShell/PowerShell

The quote character at \x{201F} (or `u{201F} (‟) seems to have been missed in PowerShell's support for the extra quote characters.

There are 4 quotes in each set, from \x{2018}-\x{201B} (single quotes) and \x{201C}-\x{201F} (double quotes). The only one not supported is \x{201F}. Was this an oversite or a typo?

Issue-Question Up-for-Grabs

Most helpful comment

I know the primary reason for supporting the 'curly' Unicode quotes was the desire in the beginning to allow new PowerShell users to use what ever editor they had at their disposal, which includes editors like Word, which is more of a word processor/printed document editor. I know first hand how hard it can be to control Word's quoting (or apostrophe).

All 4 comments

It _sounds_ like it's an oversight, to be honest. It should be a simple fix, too, I know exactly where that code's at.

Does anyone know if there's a reason this wouldn't have been included in the set of recognised quotes?

Certainly a curious omission.

As an aside: More quote characters exist, such as " (FULLWIDTH QUOTATION MARK, U+FF02), so I wonder how the currently supported subset was chosen.

A while ago I've tried to summarize what non-ASCII-range punctuation and whitespace chars. PowerShell accepts interchangeably syntactically in this Stack Overflow answer - I've just updated it to point to this issue.

Source-code link: https://github.com/PowerShell/PowerShell/blob/2cd4a4870a16808442421722a3c8b90b66747aa0/src/System.Management.Automation/engine/lang/parserutils.cs#L35-L41

I know the primary reason for supporting the 'curly' Unicode quotes was the desire in the beginning to allow new PowerShell users to use what ever editor they had at their disposal, which includes editors like Word, which is more of a word processor/printed document editor. I know first hand how hard it can be to control Word's quoting (or apostrophe).

To clarify, it wasn't so much as allow use of Word as an editor PowerShell, but to allow users to cut and paste example PowerShell from Word (or Outlook) and have it work. Word has a tendency to change the ascii quotes to fancy unicode quotes.

Was this page helpful?
0 / 5 - 0 ratings