Author Topic: [Solved] Asian text of the final solution, do not modify the code.  (Read 2100 times)

Offline Chun Jiu

  • Multiple posting newcomer
  • *
  • Posts: 43
  • My Girlfriend
    • EasilyGCC
This problem has been solved, see http://forums.codeblocks.org/index.php/topic,20937.0.html

Hi guys,

I found let wxSmith output utf-8 format file, the wxSmith need to know in advance that the file is utf-8 format.

But, now all the files generated by the wizard do not contain Asian characters.

So, the wxSmith can not determine the encoding of the file is ANSI, or UNICODE, or Windows-936, and it outputs a final ANSI format files, and abandoned Asian characters.


My solution before use wxSmith, first insert in a file which Asian characters. For example, by a "*"  using Asian character "★" to replace, then the wxSmith output the correct encoding of the file:

Code: [Select]
/***************************************************************
 ★ Name:      EasilyGCC_TemplateMain.cpp
 ★ Purpose:   Code for Application Frame
 ★ Author:    EasilyGCC
 ★ Created:   2016-01-26
 ★ Copyright: EasilyGCC
 ★ License:
 **************************************************************/

#include "wx_pch.h"
#include "EasilyGCC_TemplateMain.h"
#include <wx/msgdlg.h>
...
« Last Edit: February 13, 2016, 05:24:26 am by Chun Jiu »
I love my girlfriend like c++!    :-)

http://pan.baidu.com/s/1feNwU
easilygcc is a gmail's email.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9488
Re: Asian text of the final solution, do not modify the code.
« Reply #1 on: February 10, 2016, 08:19:21 am »
Can you provide step-by-step instructions how to reproduce the issue, first please?

It sounds weird to always include a file with an Asian character to fix something. That might be a work-around but surely not a good approach in general.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline Chun Jiu

  • Multiple posting newcomer
  • *
  • Posts: 43
  • My Girlfriend
    • EasilyGCC
Re: Asian text of the final solution, do not modify the code.
« Reply #2 on: February 10, 2016, 01:00:25 pm »
Can you provide step-by-step instructions how to reproduce the issue, first please?

It sounds weird to always include a file with an Asian character to fix something. That might be a work-around but surely not a good approach in general.

Hi MortenMacFly,

I've been using the SVN version, some changes in the process do not remember.

At present, some steps may also be reproduced (windows 7 32 & 64, tdm-gcc 5.10 32bit):

  • The editor option "Encoding Settings-> Encoding" set to UTF-8;
  • Create a wxWidgets project;
  • Choose which wxWidgets 2.8.x, wxSmith, frame based, use wxwidgets dll, enable unicode ... until the project created;
  • The *.wxs File to add some widgets by wxSmith;
  • Set a button labeled to Asian characters, For Example : "中文", and save all files;
  • Open the * .wxs corresponding * .cpp file using a hex editor, you will find *.wxs file is UTF-8, and *.cpp is Windows-936, or ANSI.
  • Then start compiling...

Sometimes the CodeBlocks will say illegal characters, it will be converted to UTF-8.


Other times the wxWidgets library reported an error:
« Last Edit: February 10, 2016, 03:00:48 pm by Chun Jiu »
I love my girlfriend like c++!    :-)

http://pan.baidu.com/s/1feNwU
easilygcc is a gmail's email.

Offline Chun Jiu

  • Multiple posting newcomer
  • *
  • Posts: 43
  • My Girlfriend
    • EasilyGCC
Re: Asian text of the final solution, do not modify the code.
« Reply #3 on: February 10, 2016, 01:12:42 pm »
If you use an editor (e.g. Notepad++) to *.wxs corresponding *.cpp file to add an Asian character, and save (format UTF-8). Then use wxSmith of the Code::blocks to edit the *.wxs file. The wxSmith will directly generate a UTF-8 file instead Windows-936, or ANSI file. So to compile without any errors occurred.

« Last Edit: February 10, 2016, 01:35:14 pm by Chun Jiu »
I love my girlfriend like c++!    :-)

http://pan.baidu.com/s/1feNwU
easilygcc is a gmail's email.