title: UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 55: character maps to <undefined>
body: <p>I am new to Python and am hoping that someone could please explain to me what the error message means. </p>
  
  <p>To be specific, I have some code of Python and SPSS combined together saved in Atom, which was created by a former colleague. Now since the former colleague is not here anymore, I need to run the code now. What I did was I ran the code below from SPSS22. </p>
  
  <pre><code>    begin program.
      import spss,spssaux,imp
      abcvalid = imp.load_source('abcvalid', "I:/VALIDITY CHECK/Python Library/2016/abcvalid2016.py") 
      import abcvalid
      abcvalid.fullprocess("9_26_2016","M:/Users/Yli\2016 SURVEY/DOWNLOADS/9_26_2016/","M:/Users/Yli/2016 SURVEY/Legacy15.sav")
      end program.
  </code></pre>
  
  <p>Then I got the following from the output.</p>
  
  <pre><code>    Traceback (most recent call last):
        File "&lt;string&gt;", line 5, in &lt;module&gt;
        File "I:/VALIDITY CHECK/Python Library/2016/abcnvalid2016.py", line 2067, in fullprocess
          dataprep(date,filepath,legacypath)
        File "I:/VALIDITY CHECK/Python Library/2016/abcvalid2016.py", line 2006, in dataprep
          emailslower(date,filepath)
        File "I:/VALIDITY CHECK/Python Library/2016/abcvalid2016.py", line 1635, in emailslower
          DATASET ACTIVATE comment_data.""".format(date,filepath))
        File "C:\PROGRA~1\IBM\SPSS\STATIS~1\22\Python\Lib\site-packages\spss\spss.py", line 1494, in Submit
          cmdList = spssutil.CheckStr(cmdList)
        File "C:\PROGRA~1\IBM\SPSS\STATIS~1\22\Python\Lib\site-packages\spss\spssutil.py", line 166, in CheckStr
          s1 = unicode(mystr,locale.getlocale(locale.LC_CTYPE)[1])
        File "C:\Program Files\IBM\SPSS\Statistics\22\Python\lib\encodings\cp1252.py", line 15, in decode
          return codecs.charmap_decode(input,errors,decoding_table)
      UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 55: character maps to &lt;undefined&gt;
  </code></pre>
  
  <p>I know there are similar questions on this site, but the questions and answers were too hard for me to comprehend. If someone could please help me, I'd really appreciate it!</p>
  
  <p>Thank you in advance!</p>