Re: Converting MBCS project to UNICODE compliant.. Pros and Cons
sachin wrote:
i want to convert my project which is compiled using Multi Byte character
set to UNICODE character set .
what is the best way of doing it?
The best way is to not do it, because then you're automatically done.
Seriously, without defining "best", this is impossible to answer.
i mean should i use use TCHAR compatible functions or WCHAR ?
If you want to optionally compile MBCS, using TCHAR would be useful.
Otherwise, you can as well directly switch to WCHAR.
apart from converting these basic functions and variables do i have to
take any other precaution ?
You can use a very simple way for the first conversion, and that is to make
your code independent of the _UNICODE macro. It means that you will not use
_T() and that you use CreateFileA() directly instead of the CreateFile
macro. Then, in a second step, you can switch those parts where you
actually want to use a WCHAR interface.
Also does it have any impact on Performance of program ?
Since modern MS Windows variants are WCHAR-based, you will save one
conversion every time you don't use a CHAR interface. Plus, you will save a
conversion that can fail.
Uli
--
C++ FAQ: http://parashift.com/c++-faq-lite
Sator Laser GmbH
Gesch??ftsf??hrer: Thorsten F??cking, Amtsgericht Hamburg HR B62 932