[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

PSPP::Perl and utf-8 characters

From: Rob Messer
Subject: PSPP::Perl and utf-8 characters
Date: Mon, 30 Nov 2009 22:23:32 -0800


I am attempting to use PSPP and the PSPP::Perl module to write labels and data 
that contain non-ASCII characters.  Below is a simple test script that includes 
Chinese characters (encoded as UTF-8) in the value labels.  The file is created 
without errors, but when I open it, either in psppire or SPSS version 18, the 
labels appear as garbled text.  I am using the latest development version 
0.7.2.  Should this be working correctly?  Is anyone else having success 
writing utf-8 via the PSPP::Perl module?  Thanks,


use PSPP;

my $dict = PSPP::Dict->new ();

my $var1 = PSPP::Var->new ($dict, "Q1", (fmt=>PSPP::Fmt::F, width=>2, 
decimals=>0) );
$var1->add_value_label (0, q|航空和国防|);
$var1->add_value_label (1, q|无线通讯|);

my $sysfile = PSPP::Sysfile->new ('testfile.sav', $dict);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]