Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: jimmyo on August 10, 2007, 10:49:24 am

Title: shared source file codepage trouble
Post by: jimmyo on August 10, 2007, 10:49:24 am
Hello,

i use same source file under Windows with Visual Studio
and under Linux with Code::Blocks IDE.

if the sourcefile under windows has some extras char äöü,
CB-IDE convert it to other spcial chars
ö = ö
after compare this file for changes, i always have this changes.
can i change the codepage in CB-IDE, that it does not change this chars ?

Thanks
  Jimmy

Title: Re: shared source file codepage trouble
Post by: dje on August 10, 2007, 11:42:12 am
Hi !

You have to play with default encoding on the Settings\Editor...

Dje
Title: Re: shared source file codepage trouble
Post by: Biplab on August 10, 2007, 11:51:43 am
If the file has UTF-8 encoding, C::B can deal with it. Otherwise if the file has an encoding UTF-16 or above, C::B may not be able to handle it.
Title: Re: shared source file codepage trouble
Post by: rjmyst3 on August 10, 2007, 01:25:01 pm
Visual Studio cannot handle UTF-8 until version 8 (2005).
Even then, the complier will not recognize it as UTF-8 without a BOM (http://unicode.org/faq/utf_bom.html#29).

gcc expects files in UTF-8, unless instructed otherwise. But if the files have a BOM, gcc will not compile them.

I have no suggestion, just pointing out some potential problems.  :(
Title: Re: shared source file codepage trouble
Post by: dje on August 10, 2007, 02:11:55 pm
Hi Biplab !

If the file has UTF-8 encoding, C::B can deal with it. Otherwise if the file has an encoding UTF-16 or above, C::B may not be able to handle it.

Why are all these encoding available if not supported in Code::Blocks ?
What happens if they are used (I suppose they are proposed because Scintilla supports them) ?

Dje
Title: Re: shared source file codepage trouble
Post by: jimmyo on August 10, 2007, 03:12:37 pm
Hi all,

Thanks for help,
Change in the Editor Settings to WINDOWS 1252, and it work.

Thanks all,
  Jimmy
Title: Re: shared source file codepage trouble
Post by: Biplab on August 10, 2007, 04:02:14 pm
Why are all these encoding available if not supported in Code::Blocks ?
What happens if they are used (I suppose they are proposed because Scintilla supports them) ?

The code to handle encoding is there. But, I guess, it was disabled long back due to some nasty crash. :)

I had the same doubt like you and I started playing with the code to enable these options. So far I've found the following.

As you can understand, this is a vital code for C::B. Thus I'm still trying to figure out an optimal solution which I can put forward for further testing. :)

For the time being, please don't use C::B with an encoding beyond UTF-8.
Title: Re: shared source file codepage trouble
Post by: dje on August 10, 2007, 04:05:04 pm
Thanks for these precise info Biplab

Dje