[wix-devs] Escaping quotes in SWIX

Heath Stewart Heath.Stewart at microsoft.com
Sat Oct 1 10:02:03 PDT 2016


In newer JavaScript (ECMAScript) specifications, it's also used for string interpolation like $"" in C#. I almost replied with a similar message, but since it's not widely used and I've seen the double-double or double-single quote system used more often (like *shudders* VB) so that's fine. It's a little harder to deal with in a parser than a unique character, but not bad.

I'm still trying to get the team asking for it to consider alternatives, so we'll see how this goes.

Heath Stewart
Visual Studio, Microsoft
http://blogs.msdn.microsoft.com/heaths

-----Original Message-----
From: wix-devs [mailto:wix-devs-bounces at lists.wixtoolset.org] On Behalf Of Brian Drennan
Sent: Friday, September 30, 2016 4:04 PM
To: Rob Mensching <rob at firegiant.com>; WiX Toolset Developer Mailing List <wix-devs at lists.wixtoolset.org>
Subject: Re: [wix-devs] Escaping quotes in SWIX

I've seen good results in Windows PowerShell with what I believe is called the grave accent (`, also used in `markdown`). Perhaps that's a good alternative? Except for markdown and JavaScript comments in the angularjs ecosystem, I haven't really seen it used for much outside of PowerShell (it could just be that I don't get out of C# enough).



Double-quotes (quotes^2?) also work well, in my opinion. They're very easy to understand in most cases.





From: Rob Mensching<mailto:rob at firegiant.com>
Sent: Friday, September 30, 2016 12:36 PM
To: WiX Toolset Developer Mailing List<mailto:wix-devs at lists.wixtoolset.org>
Subject: Re: [wix-devs] Escaping quotes in SWIX



Thank you for the example.

Backslashes are very poor escape character in our line of business. I think the escape character is to duplicate the quote type wrapping the value.

Regards,

  Rob Mensching
  CEO
  FireGiant
_______________________________________________________________
 FireGiant  |  Dedicated support for the WiX toolset  |  https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.firegiant.com%2F&data=01%7C01%7CHeath.Stewart%40microsoft.com%7C026753ba65cb4833ddaf08d3e9861974%7C72f988bf86f141af91ab2d7cd011db47%7C1&sdata=Y%2BQ9HCL8wppKBbX2uKGs75b9%2BM0mL7tMexOpdv84wS4%3D&reserved=0


-----Original Message-----
From: wix-devs [mailto:wix-devs-bounces at lists.wixtoolset.org] On Behalf Of Heath Stewart
Sent: Thursday, September 29, 2016 3:30 PM
To: WiX Toolset Developer Mailing List <wix-devs at lists.wixtoolset.org>
Subject: Re: [wix-devs] Escaping quotes in SWIX

Partly, it's to avoid rewriting localization parsing code to handle the Python-like double-in-single quotes. But there is a valid use case as well. Consider the string (a convoluted example, but possible):

Value='Click on "What's New"'

This string wouldn't be possible without escaping the middle single quote: 'Click on "What\'s New"'

If we did consider escaping, may as well adopt all of Python's (at least quote) escaping, so that this would be possible:

Value="Click on \"What's New\"" (or even, though unnecessary, "Click on \"What\'s New\"")

Heath Stewart
Visual Studio, Microsoft
https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fblogs.msdn.microsoft.com%2Fheaths&data=01%7C01%7CHeath.Stewart%40microsoft.com%7C026753ba65cb4833ddaf08d3e9861974%7C72f988bf86f141af91ab2d7cd011db47%7C1&sdata=xLdtk5ZI1is9djDOWL8Orha3sshhN6BpWIveBBd3MwI%3D&reserved=0

-----Original Message-----
From: wix-devs [mailto:wix-devs-bounces at lists.wixtoolset.org] On Behalf Of Rob Mensching
Sent: Friday, September 23, 2016 4:18 PM
To: WiX Toolset Developer Mailing List <wix-devs at lists.wixtoolset.org>
Subject: Re: [wix-devs] Escaping quotes in SWIX

Can you provide a real world example?


_____________________________________________________________
 Short replies here. Complete answers over there: https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fwww.firegiant.com%2f&data=01%7c01%7cHeath.Stewart%40microsoft.com%7c328be84c655e4398884408d3e407ea3b%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=659fXLC6aXB%2br31SJ7z0OLMJmr2wILP4a%2boSOhXPejo%3d


-----Original Message-----
From: wix-devs [mailto:wix-devs-bounces at lists.wixtoolset.org] On Behalf Of Heath Stewart
Sent: Friday, September 23, 2016 7:16 AM
To: WiX Toolset Developer Mailing List <wix-devs at lists.wixtoolset.org>
Subject: [wix-devs] Escaping quotes in SWIX

Since we're using SWIX to drive our extension to build the new VSIX v3 format, we really haven't needed much but several times now people have run into issues escaping quotes. I documented that it supports double quotes within single quotes like Python, but in a few cases (especially in other locales) this wasn't enough.

What about adding support to escape quotes to the front-end compiler? I assume the XML parser supports entities so it would support "escaping" quites that way.

If so, any desired preference on there escape character? Most languages devs would use use a backslash so that'd be my vote.
____________________________________________________________________
WiX Toolset Developer Mailing List provided by FireGiant https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fwww.firegiant.com%2f&data=01%7c01%7cHeath.Stewart%40microsoft.com%7c328be84c655e4398884408d3e407ea3b%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=659fXLC6aXB%2br31SJ7z0OLMJmr2wILP4a%2boSOhXPejo%3d
____________________________________________________________________
WiX Toolset Developer Mailing List provided by FireGiant https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.firegiant.com%2F&data=01%7C01%7CHeath.Stewart%40microsoft.com%7C026753ba65cb4833ddaf08d3e9861974%7C72f988bf86f141af91ab2d7cd011db47%7C1&sdata=Y%2BQ9HCL8wppKBbX2uKGs75b9%2BM0mL7tMexOpdv84wS4%3D&reserved=0
____________________________________________________________________
WiX Toolset Developer Mailing List provided by FireGiant https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.firegiant.com%2F&data=01%7C01%7CHeath.Stewart%40microsoft.com%7C026753ba65cb4833ddaf08d3e9861974%7C72f988bf86f141af91ab2d7cd011db47%7C1&sdata=Y%2BQ9HCL8wppKBbX2uKGs75b9%2BM0mL7tMexOpdv84wS4%3D&reserved=0
____________________________________________________________________
WiX Toolset Developer Mailing List provided by FireGiant https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.firegiant.com%2F&data=01%7C01%7CHeath.Stewart%40microsoft.com%7C026753ba65cb4833ddaf08d3e9861974%7C72f988bf86f141af91ab2d7cd011db47%7C1&sdata=Y%2BQ9HCL8wppKBbX2uKGs75b9%2BM0mL7tMexOpdv84wS4%3D&reserved=0


More information about the wix-devs mailing list