From 71fa94505d7d559e3f6bb90092268225db826732 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Sun, 13 Dec 2009 13:19:27 +0100 Subject: [PATCH] Set the dictionary encoding of files created by the perl module. This *assumes* that all strings passed from perl will be utf8 encoded. So the documentation has been updated accordingly. --- perl-module/PSPP.xs | 1 + perl-module/lib/PSPP.pm | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/perl-module/PSPP.xs b/perl-module/PSPP.xs index 77a720ca..fef85510 100644 --- a/perl-module/PSPP.xs +++ b/perl-module/PSPP.xs @@ -584,6 +584,7 @@ CODE: struct file_handle *fh = fh_create_file (NULL, name, fh_default_properties () ); struct sysfile_info *sfi = xmalloc (sizeof (*sfi)); + dict_set_encoding (dict, "UTF-8"); sfi->writer = sfm_open_writer (fh, dict, opts); sfi->dict = dict; sfi->opened = true; diff --git a/perl-module/lib/PSPP.pm b/perl-module/lib/PSPP.pm index e5599908..2dccd10a 100644 --- a/perl-module/lib/PSPP.pm +++ b/perl-module/lib/PSPP.pm @@ -197,7 +197,7 @@ package PSPP::Var; =head3 new ($dict, $name, %input_fmt) Creates and returns a new variable in the dictionary C. The -new variable will have the name C. +new variable will have the name C. C must be a valid UTF8 string. The input format is set by the C parameter (See L). By default, the write and print formats are the same as the input format. @@ -226,7 +226,7 @@ sub new =head3 set_label ($label) -Sets the variable label to C