If the strings use the same encoding, memcmp will work fine. However, keep in mind that wide characters are of different sizes on different platforms.
If strings use different encodings, you will need a library such as ICU to deal with it.
source share