Fix JSON parsing failure during Windows platform compilation. Windows 10 x64 VS2022 perl Tools/Scripts/build-webkit --wincairo --release --no-ninja --generate-project-only Generate WebCore. 10>Traceback (most recent call last): 10> File "E:/GitHub/WebKit/Source/WebCore/css/process-css-properties.py", line 6142, in <module> 10> main() 10> File "E:/GitHub/WebKit/Source/WebCore/css/process-css-properties.py", line 6109, in main 10> properties_json = json.load(properties_file) 10> File "C:\Users\14183\AppData\Local\Programs\Python\Python38\lib\json\__init__.py", line 293, in load 10> return loads(fp.read(), 10>UnicodeDecodeError: 'gbk' codec can't decode byte 0xaf in position 400278: illegal multibyte sequence
We should specify an encoding (probably UTF-8 or ASCII) when opening the file, so that nothing locale specific happens during the build. Regressed with Python rewrite in https://commits.webkit.org/256414@main.
Could you try removing "ยง" in CSSProperties.json? I think this is the simplest solution if it fixes. https://github.com/WebKit/WebKit/blob/b1cc64631025e09fd181bffbb11e292604ab5ad1/Source/WebCore/css/CSSProperties.json#L10467 Other solutions are set env var PYTHONUTF8=1 or "-X utf8" command switch.
I didn't read comment#1. It's better idea. I'm going to create a PR.
Pull request: https://github.com/WebKit/WebKit/pull/13256
Could you test the patch? Do we need more changes?
Committed 263543@main (aad6f77b647e): <https://commits.webkit.org/263543@main> Reviewed commits have been landed. Closing PR #13256 and removing active labels.
<rdar://problem/108717925>