Closed endkb closed 6 months ago
This routine to replace fancy quotes is what is causing it to choke.
$smartSingleQuotes = '[\u2019\u2018]'
$smartDoubleQuotes = '[\u201C\u201D]'
$SoundsShowPage = $SoundsShowPage -replace $smartSingleQuotes,"'" -replace $smartDoubleQuotes,'"'
I hate fancy quotes because some programs don't display them properly, so I'm going to find a way to fix this code instead of just getting rid of it.
Edit to add: If you're a developer, STOP USING FANCY QUOTES!
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)"
Adding the above code to the script with escapes the double quote with a backslash. It also catches more fancy quotes than the old routine.
Errors from the log:
None of the metadata gets set correctly, of course.