Author Topic: wxSmith and utf8  (Read 4737 times)

Offline normunds

  • Multiple posting newcomer
  • *
  • Posts: 10
wxSmith and utf8
« 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?
 
www.valodas.com - free cross-platform language learning software

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: wxSmith and utf8
« Reply #1 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

Offline normunds

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: wxSmith and utf8
« Reply #2 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.
www.valodas.com - free cross-platform language learning software

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: wxSmith and utf8
« Reply #3 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. :)
Be a part of the solution, not a part of the problem.

Offline normunds

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: wxSmith and utf8
« Reply #4 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?
www.valodas.com - free cross-platform language learning software

Offline rjmyst3

  • Multiple posting newcomer
  • *
  • Posts: 117
    • wxFormBuilder
Re: wxSmith and utf8
« Reply #5 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 ..."