Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: normunds on March 03, 2008, 09:41:16 am

Title: wxSmith and utf8
Post by: normunds on March 03, 2008, 09:41:16 am
Hi!

I'm using codeblocks 8.02 with wxSmith on WinXP. Settings->Editor->Default encoding is set to UTF8. When I'm creating new dialogs or changing some dialog properties, my cpp file encoding is switching from UTF8 to windows-xxxx.
Not always but often. Any solution?
 
Title: Re: wxSmith and utf8
Post by: byo on March 03, 2008, 10:23:28 am
Could you describe this problem better? Some step-by-step solution to reproduce. You can also help by filling up the bug report.

Regards
   BYO
Title: Re: wxSmith and utf8
Post by: normunds on March 04, 2008, 08:40:34 am
The problem is that I can't understand myself the system when it happens. Usually when I'm creating new Panel, it is in Windows-1257 code page, but not always. I'm using non-ascii characters in label captions, so there is impossible to compile project (wxWidgets is in Unicode mode). So I'm changing those files manually to UTF8, but sometimes CodeBlocks is changing files back to Windows-1257 by saving.
I started developing my project in Linux but now continue in WinXP. Some of project files are in DOS some in UNIX format. All .wxs files are UTF8 and UNIX. There is no problems with my other projects, but I didn't use non-ascii characters before. All files in my other projects are in UTF8 format.
Title: Re: wxSmith and utf8
Post by: Biplab on March 04, 2008, 12:01:48 pm
The problem is that I can't understand myself the system when it happens. Usually when I'm creating new Panel, it is in Windows-1257 code page, but not always. I'm using non-ascii characters in label captions, so there is impossible to compile project (wxWidgets is in Unicode mode). So I'm changing those files manually to UTF8, but sometimes CodeBlocks is changing files back to Windows-1257 by saving.
I started developing my project in Linux but now continue in WinXP. Some of project files are in DOS some in UNIX format. All .wxs files are UTF8 and UNIX. There is no problems with my other projects, but I didn't use non-ascii characters before. All files in my other projects are in UTF8 format.

My guess, you are saving the file in UTF-8 without BOM. Thus if there is no Non-ascii characters in your file, your file would look like a normal ASCII file. There C::B fails to recognise your file as UTF-8 encoded one.

Try saving the file with BOM, i.e. UTF8+BOM. That should help C::B recognise UTF-8 encoded files more easily. :)
Title: Re: wxSmith and utf8
Post by: normunds on March 04, 2008, 02:08:55 pm
My guess, you are saving the file in UTF-8 without BOM. Thus if there is no Non-ascii characters in your file, your file would look like a normal ASCII file. There C::B fails to recognise your file as UTF-8 encoded one.

Try saving the file with BOM, i.e. UTF8+BOM. That should help C::B recognise UTF-8 encoded files more easily. :)

can you tell me, where should I check in editor options to save from C::B files with BOM information? UTF16?
Title: Re: wxSmith and utf8
Post by: rjmyst3 on March 04, 2008, 02:47:30 pm
The problem is that I can't understand myself the system when it happens. Usually when I'm creating new Panel, it is in Windows-1257 code page, but not always. I'm using non-ascii characters in label captions, so there is impossible to compile project (wxWidgets is in Unicode mode). So I'm changing those files manually to UTF8, but sometimes CodeBlocks is changing files back to Windows-1257 by saving.
I started developing my project in Linux but now continue in WinXP. Some of project files are in DOS some in UNIX format. All .wxs files are UTF8 and UNIX. There is no problems with my other projects, but I didn't use non-ascii characters before. All files in my other projects are in UTF8 format.

My guess, you are saving the file in UTF-8 without BOM. Thus if there is no Non-ascii characters in your file, your file would look like a normal ASCII file. There C::B fails to recognise your file as UTF-8 encoded one.

Try saving the file with BOM, i.e. UTF8+BOM. That should help C::B recognise UTF-8 encoded files more easily. :)

Be careful with the BOM, last time I tried it, GCC failed to compile with warnings like "stray character in file ..."