File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change 1- <?xml version =" 1.0" encoding =" utf-8" ?>
1+ <?xml version =" 1.0" encoding =" utf-8" ?>
22<Project DefaultTargets =" Build" ToolsVersion =" 4.0" xmlns =" http://schemas.microsoft.com/developer/msbuild/2003" >
33 <ItemGroup Label =" ProjectConfigurations" >
44 <ProjectConfiguration Include =" Debug|Win32" >
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env python3
2+ #
3+ # Fixes encoding of the project files to add UTF-8 BOM.
4+ #
5+ # Visual Studio insists on having the BOM in project files, and will
6+ # restore it on first edit. This script will go through the relevant
7+ # files and ensure the BOM is included, which should prevent too many
8+ # irrelevant changesets.
9+ #
10+
11+ from pathlib import Path
12+
13+ __author__ = "Steve Dower <[email protected] >" 14+ __version__ = "1.0.0.0"
15+
16+ def fix (p ):
17+ with open (p , 'r' , encoding = 'utf-8-sig' ) as f :
18+ data = f .read ()
19+ with open (p , 'w' , encoding = 'utf-8-sig' ) as f :
20+ f .write (data )
21+
22+ ROOT_DIR = Path (__file__ ).resolve ().parent
23+
24+ if __name__ == '__main__' :
25+ count = 0
26+ print ('Fixing:' )
27+ for f in ROOT_DIR .glob ('*.vcxproj' ):
28+ print (f' - { f .name } ' )
29+ fix (f )
30+ count += 1
31+ for f in ROOT_DIR .glob ('*.vcxproj.filters' ):
32+ print (f' - { f .name } ' )
33+ fix (f )
34+ count += 1
35+ print ()
36+ print (f'Fixed { count } files' )
You can’t perform that action at this time.
0 commit comments