Are you sure that what you're putting in is valide UTF-8 ? I suspect that it isn't.
I'm attaching a simple test file, based on your test, which writes some UTF-8
labels.
The first label is ascii. The second and third contain european characters,
the fourth
contains a couple of chinese characters that I copied from some chinese web
site.
Running this perl fragment produces a .sav file which the latest master version
reads
perfectly.
J'
On Mon, Nov 30, 2009 at 10:23:32PM -0800, Rob Messer wrote:
Hello,
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,
Rob
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);
$sysfile->close();
_______________________________________________
Pspp-users mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/pspp-users
--
PGP Public key ID: 1024D/2DE827B3
fingerprint = 8797 A26D 0854 2EAB 0285 A290 8A67 719C 2DE8 27B3
See http://pgp.mit.edu or any PGP keyserver for public key.
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, "ascii");
$var1->add_value_label (1, "????t????");
$var1->add_value_label (2, "fa??");
$var1->add_value_label (3, "??????");
my $sysfile = PSPP::Sysfile->new ('testfile.sav', $dict);
$sysfile->close();
signature.asc
Description: Digital signature
_______________________________________________ Pspp-users mailing list [email protected] http://lists.gnu.org/mailman/listinfo/pspp-users
