mercredi 29 juillet 2015

How can I check if my string contains garbage characters

I have a function which receives a wchar_t string as an input. Due to this function being potentially called from several places, it can contain valid information, be empty, or might contain garbage characters.

It has then to be copied using _tcscpy_s.

Unfortunately, this will break if the incoming whcar_t string has garbage characters.

Is there any way to detect if information in the string is garbage, i.e., invalid Unicode characters?

Aucun commentaire:

Enregistrer un commentaire