News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

getting lots of stray errors due to file encoding incompatibility

Started by ausairman, July 05, 2011, 09:57:37 AM

Previous topic - Next topic

ausairman

Hi everyone,
I use codeblocks on both ubuntu and windows, and have been writing most of my code in ubuntu lately. However, now when I try to run my programs I get a bunch of "error: stray '/###' in program" where ### is usually 239, 187 or 191. I have looked over my files in notepad but can't see any of the usual suspects (' instead of ', etc.). Besides it runs fine on ubuntu. I am guessing this means that it's a file encoding problem right? Is there some easy fix for this, like converting them to a format that both windows and ubuntu use? If so, how does one go about doing that?
Ubuntu 11.04 (64-bit), optiplex 990 i7

oBFusCATed

1. Don't use anything outside of the ASCII set, else you'll have problems
2.1. You can use power-editor of your choice to do the conversion (utraedit, probably scite, ...)
2.2. You can install and use iconv to convert the characters
3. You can edit the characters inside C::B
4. Probably you could play with Edit->File encoding to see if it fixes the problem (I guess not)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Jenna

If the file is saved as unicode and not utf-8 it might not be usable on windows.
If it is utf-8, make sure it is not saved with the byte-order-mark (BOM). You can change encoding via "Edit-> File encoding" and save it afterwards.

ausairman

Quote from: jens on July 05, 2011, 02:06:06 PM
If the file is saved as unicode and not utf-8 it might not be usable on windows.
If it is utf-8, make sure it is not saved with the byte-order-mark (BOM). You can change encoding via "Edit-> File encoding" and save it afterwards.

I converted the offending files to UTF-8 (Without BOM), and this fixed the problem. The files were all in UTF-8 - presumably with BOM. If I problems with these files in Ubuntu now I'll post back!
Ubuntu 11.04 (64-bit), optiplex 990 i7