When I create a new project in code blocks and run default (hello world!) program
everything is okay. But when I change something in my program suddenly it
gives error like this:
expected unqualified-id before '+' token
on first line.
When I open my main.cpp file with notepad I see that before and after every word
are added ‘+’ and same other symbols, for example, before #include is added
+ACM.
It looks like this:
+ACM-include+ACAAPA-iostream+AD4ADQAKAA0ACg-using+ACA-namespace+ACA-std+ADsADQAKAA0ACg-int+ACA-main()+AA0ACgB7AA0ACgAgACAAIAAg-printf(+ACIAJQ-d+ACI-,+ACA-454565)+ADsADQAKACAAIAAgACA-return+ACA-0+ADsADQAKAH0ADQAK-
It’s UTF-7 encoding, and your example is this:
Once something is saved in UTF-7, it’s impossible to detect automatically whether it’s UTF-7 or ASCII. Your editor is probably configured to save in UTF-7; you have to find this setting and replace with something sensible (like UTF-8).