InteractiveAdvertisingBureau / GDPR-Transparency-and-Consent-Framework

Technical specifications for IAB Europe Transparency and Consent Framework that will help the digital advertising industry interpret and comply with EU rules on data protection and privacy - notably the General Data Protection Regulation (GDPR) that comes into effect on May 25, 2018.
855 stars 359 forks source link

\n control character is the newest purposes-xx.json and vendor-json #359

Closed mredl closed 7 months ago

mredl commented 7 months ago

in the latest json files there are some unexpected control characters, which cause a fail of parsing the json.

an example, the \n: {"id":2,"name":"Verwendung reduzierter Daten zur Auswahl von Werbeanzeigen\n\n","description":

HeinzBaumann commented 7 months ago

Not sure I follow. newlines '\n' in strings are correct syntax, also in JSON.

mredl commented 7 months ago

just try this in any browser console: JSON.parse('{"result":true, "test":"break here\n"}');

you will get this error: VM173:1 Uncaught SyntaxError: Bad control character in string literal in JSON at position 34 (line 1 column 35) at JSON.parse (<anonymous>) at <anonymous>:1:6

HeinzBaumann commented 7 months ago

Some JSON interpreter allow that syntax others don't. There is a lot of debate on this on the web. Anyway the name strings in our JSON should not have an special characters like \n. I removed these. An update of the German translation should be available by end of this week.