Developer forums (C::B DEVELOPMENT STRICTLY!) > Contributions to C::B

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

(1/1)

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

--- End code ---

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.

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.

--- End quote ---

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:

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.

Navigation

[0] Message Index

Go to full version