Fix config.xml corruption when it contains multi-byte UTF8 characters.
[dcpomatic.git] / src / lib / dcp_video.cc
index 153f4997ed7dbdbaf14afe693a76ae0476fa7c1a..ed68299bb45319d611606fb8a5b6451558be06e4 100644 (file)
@@ -226,7 +226,7 @@ DCPVideo::encode_remotely (EncodeServerDescription serv, int timeout)
                /* Send XML metadata */
                auto xml = doc.write_to_string ("UTF-8");
                socket->write (xml.length() + 1);
-               socket->write ((uint8_t *) xml.c_str(), xml.length() + 1);
+               socket->write ((uint8_t *) xml.c_str(), xml.bytes() + 1);
 
                /* Send binary data */
                LOG_TIMING("start-remote-send thread=%1", thread_id ());