Login  Register

"Text value unmappable to the current locale"

Posted by Albert-Jan Roskam on Jul 22, 2011; 11:54am
URL: http://spssx-discussion.165.s1.nabble.com/Text-value-unmappable-to-the-current-locale-tp4622811.html

Hi,

I want to create a test sav file that contains some text in Arabic (the text between BEGIN DATA - END DATA is some copy-pasted text from http://www.bbc.co.uk/arabic/). When I run the code below, I get the following message: "Text value unmappable to the current locale". What can I do to make this work? I want to use this file to test a Python program that reads spss files. If the program reads a sav file from a foreign locale, I want to temporarily set the locale so the terminal encoding is compatible with the file encoding. (I hope I understood this fuzzy topic!)

preserve.
set unicode = on.
set locale 'Arabic'.
data list free x (500).
begin data
الصومال: حركة الشباب تتهم الأمم المتحدة بالمبالغة في وصف حال المجاعة لأسباب سياسية
منطقة اليورو توافق على حزمة مساعدات جديدة لليونان
العفو الدولية: مشروع قانون الإرهاب السعودي سيجرم المعارضة المشروعة
مصر: شرف يتعهد بتحقيق أهداف الثورة
اقالة صحفي بارز من صحيفة يمتلكها مردوخ على خلفية فضيحة التنصت
end data.
save outfile = "d:/temp/arabic.sav".
restore.

Cheers!!
Albert-Jan

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a fresh water system, and public health, what have the Romans ever done for us?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~