json_data: Autorepair corrupted project files
If a file is detected as having corrupted unicode escapes, we make a backup copy as filename.osp.bak (or filename.osp.bak.1...), then regexp-replace all of the broken escapes with corrected ones. Then we run the file through json.loads() and json.dumps() again to remove the escaped characters, and write the results back to the original file location as UTF-8.
Showing
想要评论请 注册 或 登录