tchar safe functions -- count parameter for UTF-8 constants

Posted by Dustin Getz on Stack Overflow See other posts from Stack Overflow or by Dustin Getz
Published on 2010-06-07T21:49:28Z Indexed on 2010/06/07 21:52 UTC
Read the original article Hit count: 296

Filed under:
|
|
|
|

I'm porting a library from char to TCHAR. the count parameter of this fragment, according to MSDN, is the number of multibyte characters, not the number of bytes. so, did I get this right?

_tcsncmp(access, TEXT("ftp"), 3); //or do i want _tcsnccmp?

"Supported on Windows platforms only, _mbsncmp and _mbsnbcmp are multibyte versions of strncmp. _mbsncmp will compare at most count multibyte characters and _mbsnbcmp will compare at most count bytes. They both use the current multibyte code page.

_tcsnccmp and _tcsncmp are the corresponding Generic functions for _mbsncmp and _mbsnbcmp, respectively. _tccmp is equivalent to _tcsnccmp."

© Stack Overflow or respective owner

Related posts about c++

Related posts about Windows