Ok, so occassionally as I write my code, a non-printing character is insterted... according to code::blocks this character is actually two characters (\302 and \206). I have done much searching to solve the problem, but a solution has eluded me. I tried using the windows console type command on a file containing the character in question and it printed what I believe to be ASCII values 194 and 134 (first character is sorta like a T for making tables and second is an a with a circle above it). I have tried everything to stop this problem, but have not been successful... any advice?

Recommended Answers

All 2 Replies

For me, these characters seem to appear when I do ALT + SPACE. I sometimes get those because I use a french-canadian keyboard and the {} and [] brackets (and a few others) require using the ALT key and they are often followed or preceded with a space, and so, the ALT + SPACE combination happens once in a while and leaves those \302 and \240 stray characters, and the compiler gets angry when it sees them. The character-pair \302\240 is the "NO-BREAK SPACE" from UTF-8 encoding (302 and 240 are indeed octal numbers). The character \302\206 is probably something similar (all 302 combinations are weird silent UTF-8 things), you can try and see what key combination generates it on your system, and you might also find a way to disable that key combination too. (question: What OS is this? I suspect a Linux distro or Mac, given the native use of UTF8 to encode keystrokes)

The IDE that I am using (KDevelop, which uses the Kate editor) highlights those characters when they occur, so I can immediately correct it. Normally, these two characters, together, appear as one space (or nothing at all), and if your editor doesn't highlight it, it will go unnoticed. So, you can try and get an editor that will highlight those stray characters (or see what you can do with the settings of your current editor). Or, you can write a simple character-replacement script that will find those character combinations and replace them with a space character. Otherwise, just be more careful when typing spaces near characters that require you to use the ALT key.

N.B.: I think that a similar problem might occur with SHIFT + SPACE on some systems.

I have heard a similar answer before, and I have tried pretty much every combination of X+Y+SPACE+Z possible. I don't think it is a space-bar problem. It seems to me that the character is generated any time I activate the C::B window by clicking in the code editing area (this causes the character to appear, but does not account for all of them). I am still in the dark about this, its a minor thing, but it gets annoying pretty fast. I will try to find out exactly what happens to cause the character, but so far all my attempts have been in vain. I was wondering if anybody had any theories as to what might be causing them so I could test them out.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.