command line strings should also be converted to the systemencoding
use Unicode API (#115)

NOTE: The binary compatibility is lost with this change.
The version number should be updated.
define a macro for getting the length of an array
fix for old MSVC

VC2003 doesn't support vsnprintf.