https://github.com/lucasg/msvcunicodeupdater
A Python CLI useful for updating a legacy C++ codebase in order to get full Unicode support
https://github.com/lucasg/msvcunicodeupdater
Last synced: 2 months ago
JSON representation
A Python CLI useful for updating a legacy C++ codebase in order to get full Unicode support
- Host: GitHub
- URL: https://github.com/lucasg/msvcunicodeupdater
- Owner: lucasg
- License: mit
- Created: 2015-04-15T19:08:09.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-04-15T19:32:03.000Z (about 10 years ago)
- Last Synced: 2025-03-17T20:41:17.649Z (3 months ago)
- Language: Python
- Size: 141 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MSVCUnicodeUpdater
A Python CLI useful for updating a legacy C++ codebase in order to get full Unicode supportThis project cater for thoses who need to upgrade existing code in order to support multi-bytes encodings with MVSC. It basically involves adding several macros (_T or _TEXT) around raw strings and using _TCHAR independant functions like _ttoi instead of atoi. Since it's a tedious and repetitive task, it can be greatly sped up by automating the detection and replacement part. Of course, the verification part is left to the human eye (not every char array is a string).
More info on _UNICODE support :
- https://msdn.microsoft.com/library/2dax2h36.aspx
- https://msdn.microsoft.com/library/vstudio/c426s321The python files were written for Python3, but it can be backported to Python2.xx quite easily. diff.py and updater.py relies on docopt for command-line arguments management, so docopt need to be present.
Files :
- sed.py : every little replacement rules
- diff.py : given a folder containing sources files, diff.py produces a json file with every modification (machine readable) and a diff file (human readable).
Look at example_output.json & example_output.diff for a sample.
- updater.py : updater is a script built on top of diff.py which also check-out sources file from SourceSafe before-hand.
- vss.py : a SourceSafe automation bot copied from somewhere on Internet, and catered to this project's needs.```
Usage:
diff.py [-arf] [-n |--name ] [-o |--output ] (INPUT_FOLDER)
updater.py [-arf] [-n |--name ] [-o |--output ] (INPUT_FOLDER)
diff.py -h | --helpOptions:
-h --help
-n --name=
choose the generated files' name, without extensions.
By default it's the input folder base name.
-o --output=
select where to output the generated files
-a --apply
apply modification to every remplacement found
-r
look recursively (not implemented yet)
-file
work on a single file (instead of folder)
```