> > I suggest to use the API _mbsnbcpy in msvcrt.dll in that case. I need to also replace illegal file characters so there has to be a char-by-char check, then the truncation.
I don't > know if this API exists in all versions of Windows, but found it quite > handy. One problem is that this API does not null-terminated the > copied string, so better initialize the destination buffer with NULLs. > Actually I used instead StrCpyN(A) in shell32.dll for that, however, > this API seems not documented in MSDN. I use the C-lib strncpy function, although I suspect is it now depracated for security reasons. >
