title: Python: convert space (and other special chars like . , ) to their corresponding unicode representations
body: <p>I am trying to convert an Arabic phrase into its corresponding unicode representation string and it works fine for the Arabic text.</p>
  
  <pre><code>&gt;&gt;&gt; a = ' مساء الخير'
  &gt;&gt;&gt; a.strip().decode('utf-8').encode('unicode-escape')
  '\\u0645\\u0633\\u0627\\u0621 \\u0627\\u0644\\u062e\\u064a\\u0631'
  </code></pre>
  
  <p>However, I also want the space-character to be converted to its unicode representation ('\u0020'). I am observing similar behaviour with other characters like '.', ',', etc. I finally want to obtain the unicode values of each of the characters in my string as a list <em>(simply splitting the current string with the delimiter '\u' gives me the incorrect split as the space character becomes combined with the previous unicode representation)</em></p>
  
  <pre><code>&gt;&gt;&gt; a.strip().decode('utf-8').encode('unicode-escape').split('\\u') 
  ['', '0645', '0633', '0627', '0621 ', '0627', '0644', '062e', '064a', '0631']
  </code></pre>
  
  <p>eg. I want [ ... '0621', '0020' ...] instead of the current [ ... '0621 ' ...]</p>