My personal experience of the most common problematic substitutions by tools such as Outlook, Word & some web tools:
- Double Quotes \u201c & \u201d “”
- Single Quotes \u2018 & \u2019 ‘’
- The m-hyphen \2013 –
- Copyright © \xa9 and others, Registered ® \xae and trademark ™ \u2122
- Some fractions e.g. ½ ¼
- Non-breaking spaces
As part of this discussion, it was suggested that it would be useful if some more useful messages could be given about the use of some unicode "fancy quotes".
Just in case some people were considering "wasting" time on this:
= = = =
$ python -m friendly_traceback scratch.py
SyntaxError: invalid character in identifier
A SyntaxError occurs when Python cannot understand your code.
Python could not understand the code in the file
beyond the location indicated below by --> and ^.
1: def squares(n):
Likely cause based on the information given by Python:
Did you use copy-paste?
Python indicates that you used some unicode characters not allowed
as part of a variable name; this includes many emojis.
However, I suspect that you used a fancy unicode quotation mark
instead of a normal single or double quote for a string.
= = =
This is just one of many cases now correctly identified by friendly-traceback.