
29 Jan
2011
29 Jan
'11
6:56 p.m.
On 29/01/2011 05:12, Joe Mucchiello wrote:
// UTF validation
bool is_valid_utf() const;
See, that's what makes the whole thing pointless.
Actually not, consider:
socket.read(my_string); if(!my_string.is_valid_utf()) ....
This, and many of these functions, work much better as standalone functions:
// with a string-aware function socket.read(my_string); if (!is_valid_utf8(my_string.begin(),my_string.end())) ....
or if(!is_valid_utf8(my_string))