title: How do I get rid of U+200B (Unicode zero width space) in my code?
body: <p>I have this piece of Python code:</p>
  <pre><code># Subroutine to calculate VAT​
  def VAT(Total):​
      return Total * 0.05 ​
  
  # Main program​
  Total = 100.12​
  ValueAddedTax = VAT(Total)​
  ToPay = Total + ValueAddedTax​
  print(&quot;Total £{:.2f} VAT £{:.2f} To pay £{:.2f}&quot;.format(Total, ValueAddedTax, ToPay))
  </code></pre>
  <p>When running this, I get:</p>
  <pre class="lang-none prettyprint-override"><code>    def VAT(Total):​
                     ^
  SyntaxError: invalid character in identifier
  </code></pre>
  <p>The reason is that the code contains <a href="https://codepoints.net/U+200B?lang=en" rel="nofollow noreferrer">U+200B ZERO WIDTH SPACE</a> (UTF-8 encoding: E2 80 8B), as seen in the output of <code>hexdump -C</code>:</p>
  <pre>
  00000000  23 20 53 75 62 72 6f 75  74 69 6e 65 20 74 6f 20  |# Subroutine to |
  00000010  63 61 6c 63 75 6c 61 74  65 20 56 41 54 <b>e2 80 8b</b>  |calculate VAT...|
  00000020  0a 64 65 66 20 56 41 54  28 54 6f 74 61 6c 29 3a  |.def VAT(Total):|
  00000030  <b>e2 80 8b</b> 0a 20 20 20 20  72 65 74 75 72 6e 20 54  |....    return T|
  00000040  6f 74 61 6c 20 2a 20 30  2e 30 35 20 <b>e2 80 8b</b> 0a  |otal * 0.05 ....|
  00000050  0a 23 20 4d 61 69 6e 20  70 72 6f 67 72 61 6d <b>e2</b>  |.# Main program.|
  00000060  <b>80 8b</b> 0a 54 6f 74 61 6c  20 3d 20 31 30 30 2e 31  |...Total = 100.1|
  00000070  32 <b>e2 80 8b</b> 0a 56 61 6c  75 65 41 64 64 65 64 54  |2....ValueAddedT|
  00000080  61 78 20 3d 20 56 41 54  28 54 6f 74 61 6c 29 <b>e2</b>  |ax = VAT(Total).|
  00000090  <b>80 8b</b> 0a 54 6f 50 61 79  20 3d 20 54 6f 74 61 6c  |...ToPay = Total|
  000000a0  20 2b 20 56 61 6c 75 65  41 64 64 65 64 54 61 78  | + ValueAddedTax|
  000000b0  <b>e2 80 8b</b> 0a 70 72 69 6e  74 28 22 54 6f 74 61 6c  |....print("Total|
  000000c0  20 c2 a3 7b 3a 2e 32 66  7d 20 56 41 54 20 c2 a3  | ..{:.2f} VAT ..|
  000000d0  7b 3a 2e 32 66 7d 20 54  6f 20 70 61 79 20 c2 a3  |{:.2f} To pay ..|
  000000e0  7b 3a 2e 32 66 7d 22 2e  66 6f 72 6d 61 74 28 54  |{:.2f}".format(T|
  000000f0  6f 74 61 6c 2c 20 56 61  6c 75 65 41 64 64 65 64  |otal, ValueAdded|
  00000100  54 61 78 2c 20 54 6f 50  61 79 29 29 0a           |Tax, ToPay)).|
  0000010d
  </pre>
  <p>I was wondering how to get rid of all of the zero width spaces.</p>