X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-var-store.c;h=092de58cafa0ed89f827d61a617c9008a442e86a;hb=ae1be0785be76a86b0d0ace1ec820c2a4f3e313d;hp=b64bc64ee79c805d3e21cf58a4de56b4077be995;hpb=e01c43673abbb57663c265b84d0188f9fc821e33;p=pspp-builds.git diff --git a/src/ui/gui/psppire-var-store.c b/src/ui/gui/psppire-var-store.c index b64bc64e..092de58c 100644 --- a/src/ui/gui/psppire-var-store.c +++ b/src/ui/gui/psppire-var-store.c @@ -467,14 +467,15 @@ psppire_var_store_set_string (PsppireSheetModel *model, { case PSPPIRE_VAR_STORE_COL_NAME: { - int i; - /* Until non-ascii in variable names is better managed, - simply refuse to allow them to be entered. */ - for (i = 0 ; i < strlen (text) ; ++i ) - if (!g_ascii_isprint (text[i])) - return FALSE; - return psppire_dict_rename_var (var_store->dict, pv, text); - break; + gboolean ok; + char *s = recode_string (psppire_dict_encoding (var_store->dict), + UTF8, + text, -1); + + ok = psppire_dict_rename_var (var_store->dict, pv, s); + + free (s); + return ok; } case PSPPIRE_VAR_STORE_COL_COLUMNS: if ( ! text) return FALSE;