News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

[Solved] Asian text of the final solution, do not modify the code.

Started by Chun Jiu, February 10, 2016, 06:59:22 AM

Previous topic - Next topic

Chun Jiu

This problem has been solved, see http://forums.next.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:

/***************************************************************
★ 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>
...

I love my girlfriend like c++!    :-)

[url="http://pan.baidu.com/s/1feNwU"]http://pan.baidu.com/s/1feNwU[/url]
easilygcc is a gmail's email.

MortenMacFly

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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Chun Jiu

Quote from: 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.

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:
I love my girlfriend like c++!    :-)

[url="http://pan.baidu.com/s/1feNwU"]http://pan.baidu.com/s/1feNwU[/url]
easilygcc is a gmail's email.

Chun Jiu

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.

I love my girlfriend like c++!    :-)

[url="http://pan.baidu.com/s/1feNwU"]http://pan.baidu.com/s/1feNwU[/url]
easilygcc is a gmail's email.