X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-var-store.c;h=1d6f465d437e5c2605bb8001a7ddce6fd720eb3c;hb=0f70b0dd47b62dbefe87fb08ba8a8984aa5a50c4;hp=8e78e2ec62218d3a339f346acbabee03fb25bb52;hpb=28ced40c7ddd248b5d64b7b5272fb17b6e97b13a;p=pspp-builds.git diff --git a/src/ui/gui/psppire-var-store.c b/src/ui/gui/psppire-var-store.c index 8e78e2ec..1d6f465d 100644 --- a/src/ui/gui/psppire-var-store.c +++ b/src/ui/gui/psppire-var-store.c @@ -467,8 +467,16 @@ psppire_var_store_set_string (PsppireSheetModel *model, switch (col) { case PSPPIRE_VAR_STORE_COL_NAME: - return psppire_dict_rename_var (var_store->dict, pv, text); - break; + { + 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; + } case PSPPIRE_VAR_STORE_COL_COLUMNS: if ( ! text) return FALSE; var_set_display_width (pv, atoi (text)); @@ -522,8 +530,12 @@ psppire_var_store_set_string (PsppireSheetModel *model, } break; case PSPPIRE_VAR_STORE_COL_LABEL: - var_set_label (pv, text); - return TRUE; + { + gchar *s = utf8_to_pspp_locale (text, -1, NULL); + var_set_label (pv, s); + free (s); + return TRUE; + } break; case PSPPIRE_VAR_STORE_COL_TYPE: case PSPPIRE_VAR_STORE_COL_VALUES: