Reputation: 31
When I use these specials characters ^
or ¨
in python IDLE version 3, it makes the program crash.
I'm French and so I use these specials characters in my description or comments in my code. Is there a way to use it without crashing the program?
Thanks !
Upvotes: 3
Views: 1619
Reputation: 4175
Many language specifications, and most compilers, specifically recommend against using special characters because of problems like this.
However, from http://docs.python.org/2/reference/lexical_analysis.html
New in version 2.3: An encoding declaration can be used to indicate that string literals and comments use an encoding different from ASCII.
So include that declaration, and it should work.
If you already have such a declaration, the problem may then be not because of the characters themselves, but because of the way your setup combines the ^ and ¨ accents with other characters. Although at that point, I'm really just shooting in the dark.
Upvotes: 1