Search code examples
spssspsite

How do I specify the encoding of an SPSS syntax file?


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

  • 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...