JSON parse error when trying to parse translated KDE metadata json file
I was trying to write a little CMake function for reading a few key/value pairs from the json files, but got a parsing error. The error can be reproduced with the two files pasted below. The issue occurs with CMake 3.21 and CMake master.
file.json:
{
"KPlugin": {
"Description": "Automatically Started Applications",
"Icon": "system-run",
"Name": "Autostart"
},
"X-KDE-Keywords[sl]": "Upravljalnik samodejnega zagona,zagon sistema,zagon Plasme,zagon cron;samodejno;zagon;hladni zagon;inicialno nalaganje;cron,nalaganje,seja;prijava"
}
CMakeLists.txt:
project(demo)
cmake_minimum_required(VERSION 3.21)
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/file.json KCM_JSON)
string(JSON KPLUGIN_JSON GET ${KCM_JSON} "KPlugin")
message(WARNING ${KPLUGIN_JSON})
CMake Error at CMakeLists.txt:5 (string):
string sub-command JSON failed parsing json string: * Line 7, Column 27
Syntax error: value, object or array expected.