How do I specify the encoding of an SPSS syntax file?
Question
I am writing out statistical results in SPSS with code like
OMS
/ SELECT Tables Headings
/ DESTINATION FORMAT = OXML OUTFILE='C:\Temp\outfile.xml'.
The syntax file is saved as UTF-8 (with bookmark). It has some words with umlauts (german funny characters like ä, ö, ü). When I open the syntax file, it displays these umlauts as ü, ö etc. Needless to say, in the output xml file, the umlauts are still garbled.
How can I specify what encoding the syntax file is in? The bookmark (BOM) does not seem to be doing the trick.
If not, what encoding should I use for the syntax file?
Solution 2
This worked:
SET UNICODE YES
(at the top of the syntax file)
NOTE: This setting is "sticky", i.e. it persists until you change it again for all SPSS sessions on that computer. Not so nice, but I guess it will do...
OTHER TIPS
This works for me (SPSS 20):
DATASET CLOSE ALL.
NEW FILE.
SET UNICODE = OFF.
OR:
DATASET CLOSE ALL.
NEW FILE.
SET UNICODE = ON.
In fact, the first two lines are just to make sure that no dataset is opened, as this would prevent the command from being executed.