Quote:
What has worked well for me is to compile the char set of the app to the OS I was running in (in 9x, that was ANSI, and now on NT,Win7/8 it's UNICODE) and isolate string conversions to the layer that deals with any external string data. So if my app is targeted to Win7, all my strings will be in UNICODE within the app and if I'm reading or writing to a file that needs to be in ansi, I convert immediately before I write the file and convert after I need to read the file. Similar for a socket, if the data is coming in as ANSI, I convert to UNICODE before I use it in my program. I like this approach because I only have a couple of places in my code where I do any string conversions.
I've seen other approaches where folks are doing back and forth string conversions all through out their code and it makes it tough to debug and maintain code like this.
I tend to agree with that logic in as much as I can encompass the whole of it.