
44
CHAPTER 2 USING THE WINDOWS FILE SYSTEM AND CHARACTER I/O
Example: ASCII to Unicode Conversion
Program 2–4 builds on Program 1–3, which used the convenience
function. File copying is familiar by now, so this example also converts a fi le to
Unicode, assuming it is ASCII; there is no test. The program also includes some
error reporting and an option to suppress replacement of an existing file, and it
replaces the final call to
with a new function that performs the ASCII
to Unicode file conversion.
This program is concerned mostly with ensuring that the conversion can take
place successfully. The operation is captured in a single function call