Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Contributions to C::B => Topic started by: Chun Jiu on February 10, 2016, 06:59:22 am

Title: [Solved] Asian text of the final solution, do not modify the code.
Post by: Chun Jiu on February 10, 2016, 06:59:22 am
This problem has been solved, see http://forums.codeblocks.org/index.php/topic,20937.0.html (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
/***************************************************************
 ★ 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>
...
Title: Re: Asian text of the final solution, do not modify the code.
Post by: MortenMacFly 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.
Title: Re: Asian text of the final solution, do not modify the code.
Post by: Chun Jiu 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):


Sometimes the CodeBlocks will say illegal characters, it will be converted to UTF-8.
(http://forums.codeblocks.org/index.php?action=dlattach;topic=20930.0;attach=8073;image)

Other times the wxWidgets library reported an error:
(http://forums.codeblocks.org/index.php?action=dlattach;topic=20930.0;attach=8075;image)
Title: Re: Asian text of the final solution, do not modify the code.
Post by: Chun Jiu 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.