User forums > Help
getting lots of stray errors due to file encoding incompatibility
(1/1)
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?
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)
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.
--- End quote ---
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!
Navigation
[0] Message Index
Go to full version