+ /* Truncate the string to fit in 8 bytes in the dictionary
+ encoding. */
+ utf8_s = lex_tokcstr (lexer);
+ utf8_len = ss_length (lex_tokss (lexer));
+ utf8_trunc_len = utf8_encoding_trunc_len (utf8_s, encoding,
+ MV_MAX_STRING);
+ if (utf8_trunc_len < utf8_len)
+ msg (SE, _("Truncating missing value to maximum "
+ "acceptable length (%d bytes)."),
+ MV_MAX_STRING);
+
+ /* Recode to dictionary encoding and add. */
+ raw_s = recode_string (encoding, "UTF-8",
+ utf8_s, utf8_trunc_len);
+ if (!mv_add_str (&mv, CHAR_CAST (const uint8_t *, raw_s),
+ strlen (raw_s)))