From: John Darrington Date: Sun, 13 Dec 2009 12:19:27 +0000 (+0100) Subject: Set the dictionary encoding of files created by the perl module. X-Git-Tag: fc11-i386-build52^0 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp-builds.git;a=commitdiff_plain;h=71fa94505d7d559e3f6bb90092268225db826732 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. --- 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