From: John Darrington Date: Tue, 26 Oct 2010 15:11:04 +0000 (+0200) Subject: Allow perl module to enter non-ascii data X-Git-Tag: v0.7.7~170 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=150d9bdc4fc9f3edf7fef6ab5b4e8c321ef1618a;p=pspp-builds.git Allow perl module to enter non-ascii data --- diff --git a/perl-module/PSPP.xs b/perl-module/PSPP.xs index 400aeda7..a95ccf63 100644 --- a/perl-module/PSPP.xs +++ b/perl-module/PSPP.xs @@ -34,6 +34,7 @@ #include "minmax.h" #include #include +#include #include #include #include @@ -591,7 +592,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"); + dict_set_encoding (dict, UTF8); sfi->writer = sfm_open_writer (fh, dict, opts); sfi->dict = dict; sfi->opened = true; @@ -659,7 +660,7 @@ CODE: char *error; bool ok; - error = data_in (ss, LEGACY_NATIVE, ifmt->type, + error = data_in (ss, SvUTF8(sv) ? UTF8: "iso-8859-1", ifmt->type, case_data_rw (c, v), var_get_width (v), dict_get_encoding (sfi->dict)); ok = error == NULL;