I am trying to convert a
// Data has been received, update the buffer...
buffer = readBuffer.data();
buffer[bytesRead-1] = '\0';
'<A HREF="https://ww ²²²²▌▌╫$Ö►¬∟☺.google.com/">here</A>.'
Writing a null character at the end of a character vector will not magically create an
std::string. To create an actual
std::string, use something like:
std::string s = std::string(readBuffer.begin(), readBuffer.end());
You don't need to explicitly append the null character to the string, the
std::string constructor will do it for you.