/* Formats a value according to FORMAT
The returned string must be freed when no longer required */
gchar *
-value_to_text (union value v, struct fmt_spec format)
+value_to_text (union value v, PsppireDict *dict, struct fmt_spec format)
{
gchar *s = 0;
- s = g_new (gchar, format.w + 1);
- data_out (&v, &format, s);
- s[format.w]='\0';
+ s = data_out (&v, dict_get_encoding (dict->dict), &format);
g_strchug (s);
return s;