#! /usr/bin/env python3## Fixes encoding of the project files to add UTF-8 BOM.## Visual Studio insists on having the BOM in project files, and will# restore it on first edit. This script will go through the relevant# files and ensure the BOM is included, which should prevent too many# irrelevant changesets.#from pathlib import Path__author__ = "Steve Dower <steve.dower@python.org>"__version__ = "1.0.0.0"def fix(p):with open(p, 'r', encoding='utf-8-sig') as f:data = f.read()with open(p, 'w', encoding='utf-8-sig') as f:f.write(data)ROOT_DIR = Path(__file__).resolve().parentif __name__ == '__main__':count = 0print('Fixing:')for f in ROOT_DIR.glob('*.vcxproj'):print(f' - {f.name}')fix(f)count += 1for f in ROOT_DIR.glob('*.vcxproj.filters'):print(f' - {f.name}')fix(f)count += 1print()print(f'Fixed {count} files')
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。