Read UTF8 string lengths correctly when checking closed captions (part of #1446).
[dcpomatic.git] / src / lib / hints.cc
index d961b1a3022eef80240db344623b3760064b3555..6238aa991b7e6a2550f4518109694c3e932edc70 100644 (file)
@@ -311,7 +311,7 @@ Hints::text (PlayerText text, TextType type, DCPTimePeriod period)
 
        int lines = text.string.size();
        BOOST_FOREACH (StringText i, text.string) {
-               if (i.text().length() > CLOSED_CAPTION_LENGTH) {
+               if (utf8_strlen(i.text()) > CLOSED_CAPTION_LENGTH) {
                        ++lines;
                        if (!_long_ccap) {
                                _long_ccap = true;