Author Topic: I cant open my file.cpp anymore  (Read 6313 times)

Offline VUT

  • Single posting newcomer
  • *
  • Posts: 4
I cant open my file.cpp anymore
« 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

« Last Edit: April 18, 2011, 01:00:14 am by VUT »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: I cant open my file.cpp anymore
« Reply #1 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?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline VUT

  • Single posting newcomer
  • *
  • Posts: 4
Re: I cant open my file.cpp anymore
« Reply #2 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

« Last Edit: April 18, 2011, 10:59:07 pm by VUT »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: I cant open my file.cpp anymore
« Reply #3 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.

Offline VUT

  • Single posting newcomer
  • *
  • Posts: 4
Re: I cant open my file.cpp anymore
« Reply #4 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

« Last Edit: April 18, 2011, 11:46:12 pm by VUT »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: I cant open my file.cpp anymore
« Reply #5 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.

Offline VUT

  • Single posting newcomer
  • *
  • Posts: 4
Re: I cant open my file.cpp anymore
« Reply #6 on: April 19, 2011, 12:44:27 am »
 :? thanks . My cpu is little-endian...my fault   :(