The WToMString method

This method converts the wide character string from to its multibyte representation and stores it in the location pointed to by to.

int WToMString(char *to, const ITWChar *from, int limit, 
            int nfromsize =
            ITLocale::ScanToNul) const

Use limit to specify the maximum number of bytes to read from the from string and write to to. If a character to be written to to would cause more than the specified limit of bytes to be written, no part of that character is written. In this case the method writes less than the specified limit of bytes.

The nfromsize parameter specifies the length of the corresponding string from. You can provide an integer to specify the number of bytes in from. Or you can use the constant ITLocale::ScanToNul (the default) to specify that from is a null-terminated string.

This method returns the number of bytes it writes to multibyte string to.

If there is an error, this method returns -1. Call ITLocale::GetError() to retrieve a specific error message.