The reason why this error appears is because the NX_ROOT\NX.ENV and/or the NX_ROOT\pdmconf\NX.ENV_NT.TPL files was edited manually and was not saved in the right encoding.
If the file is saved in "UTF-8", "Unicode" or "Unicode big endian" encoding, the Visual C++ error will appear.
The supported and correct encoding format for the NX.ENV file is "ANSI".
Revert the environment back to the pre CA SDM upgrade and ensure that both the NX_ROOT\NX.ENV and NX_ROOT\pdmconf\NX.ENV_NT.TPL files have been saved with the proper encoding.
Reattempt the CA SDM upgrade process.