endkb / SoundsDownloadScript

Download programs from BBC Sounds and publish them to a podcast feed
2 stars 0 forks source link

Merging bugfix-escape-doublequotes into the main branch #6

Closed endkb closed 6 months ago

endkb commented 6 months ago

Double quotes were not being escaped so the JSON parser was choking.

$jsonResult = "$jsonResult" -replace '[\u201C\u201D\u201E\u201F\u2033\u2036]', "$([char]92)$([char]34)" -replace "[\u2018\u2019\u201A\u201B\u2032\u2035]", "$([char]39)"

Added the above code to the script with escapes the double quote with a backslash. It also catches more fancy quotes than the old routine did.