tags:

views:

31

answers:

1

I just discovered that %ws was common knowledge (to some), for formatting unicode strings, as is %wZ - however msdn does not document these in a place I can find them. There are many people who write about these usefull printf format types individually on the web, but no official catch-all that I can find, and hence learn that they exist.

What I'm really after is help writting mistake-free formatter code since I have in places got a mix of %s and %S and want to clean these up as far possible. I am unable to control compilation of certain shared code and toolchain scripts of the project, so I am seeking a 'canonical' article that sorts the MS spec apart from the STD spec a little.

A: 

In an ideal world the list of valid types on MSDN here would be complete. It does mention that some are Microsoft extensions.

However, there is also separate info on wsprintf formatting, which includes ws and ls as you noted.

I don't see any other type lists that apply here on MSDN.

As noted in comments, I do think your life would be easier if you left the CRT behind and moved to use iostream, but I am sure that may not be immediately practical. In general, widespread usage of CRT in what's intended to be C++ code is a cause for suspicion.

Steve Townsend