Code::Blocks Forums

User forums => Help => Topic started by: VUT on April 18, 2011, 12:04:53 am

Title: I cant open my file.cpp anymore
Post by: VUT on April 18, 2011, 12:04:53 am
Hello ,

Codeblocks cant read my source file anymore. It open the file and write this:

Code
⍩湣汵摥‼卆䵌⽇牡灨楣献桰瀾ਊ畳楮朠湡浥獰慣攠獦㬊੦汯慴⁨㴰ⱸⱹⱭ潶敹㴰Ɑ潶敹㈽〬浯癥礳㴰ⱡ湧汥㴰ⱸ㈬砱ⱸ㌻ਊ楮琠浡楮⠩੻ਊ

by other editors I am able to open the same file and  all works fine.

Can you help me pls? I cant work

OS : ubuntu 10.10
Codeblocks : 10.05
gcc (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5


Edit:
In order to avoid this 'bug' i must save file without files's extension

Title: Re: I cant open my file.cpp anymore
Post by: MortenMacFly on April 18, 2011, 07:06:23 am
Can you provide a sample so we can reproduce? What's your locale, what is your settings under Settings -> Editor -> tab "Other settings" -> everything related to encoding?
Title: Re: I cant open my file.cpp anymore
Post by: VUT on April 18, 2011, 10:14:36 pm
It happened right now  :shock:

my setting are a bit different from default

caret  width 3
Colour green
Period  305

You have to play with these Styles ( Allman, K&R,Stroustrup,Gnu,Linux) then format the code, save the file , close and open it
try an other style and repeat . I did that several times ( about 10 )
There are two bug

1) Codeblocks add NULL char to source and gcc return this msg <<warning: null character(s) ignored>>
you can see null char from an external editor. from external editor : http://img130.imageshack.us/img130/1951/bugll.png
2) file is corrupted



Add:
if you copy and paste some code's lines from file corrupted to new external file , no weird char will be printed .
then you open it by codeblocks but the file will be still corrupted by second bug ( wrong font ).
sry for bad english

Title: Re: I cant open my file.cpp anymore
Post by: Jenna on April 18, 2011, 11:01:56 pm
Can you provide a sample so we can reproduce? What's your locale, what is your settings under Settings -> Editor -> tab "Other settings" -> everything related to encoding?

Providing a sample means: attach a corrupted file or give a step by step description how to reproduce reliable.
If possible attach the corrupted and the correct version of the same file.
Title: Re: I cant open my file.cpp anymore
Post by: VUT on April 18, 2011, 11:43:48 pm
open file
change style to k&r ( or other styles Allman, K&R,Stroustrup,Gnu,Linux)
plugin-> source code formatter (Astyle)
save and close
open the file again

Added attachments .txt extension

http://img197.imageshack.us/img197/9720/screenoy.png
italy

Title: Re: I cant open my file.cpp anymore
Post by: Jenna on April 19, 2011, 12:25:07 am
If you chose UTF-16BE as default-encoding, it is not a bug if the file is saved as UTF-16BE.

I suggest using a more common file-encoding, UTF-8 should be enough and not cause problems with other editors and gcc.
Title: Re: I cant open my file.cpp anymore
Post by: VUT on April 19, 2011, 12:44:27 am
 :? thanks . My cpu is little-endian...my fault   :(