Code::Blocks Forums

User forums => Help => Topic started by: lfjking on December 11, 2016, 01:53:22 pm

Title: [Solved] EDIT cpp Chinese garbled!~!~!~!~
Post by: lfjking on December 11, 2016, 01:53:22 pm
Environment: X64 window Chinese
IDE:codeblocks 16.01

IDE encoding settings:
Compiler settings - >
Global compiler Settings - > 
Compiler settings - >
Other compiler options: 
-finput-charset=GBK
-fexec-charset=GBK

Question:
The same project, after a period of normal compilation of code, the code can not be converted to a puzzling problem
Then the CodeBlocks Editor could not see the contents of the.Cpp.
But with other text editor to open can see, but the inside of the Chinese code display is garbled
Seek solution

Title: Re: [help] EDIT cpp Chinese garbled!~!~!~!~
Post by: BlueHazzard on December 11, 2016, 07:01:36 pm
Do you talk about, that your program does not show the text correctly or do you talk about codeblocks does not show the code correctly?

About the first this is the wrong forum to ask this...

About the second: Edit -> File encoding->Set the correct encoding
Title: Re: [help] EDIT cpp Chinese garbled!~!~!~!~
Post by: lfjking on December 11, 2016, 07:47:40 pm
The question is:
build error:  failure to convert GBK to UTF-8
 
Title: Re: [help] EDIT cpp Chinese garbled!~!~!~!~
Post by: lfjking on December 11, 2016, 08:04:12 pm
All right. This is CODEBLOCKS's question all the time.
I rebuilt the document.
Although it is time to compare
It is much simpler than looking for the problem.
However, the next version of CODEBLOCKS is not a good adjustment of this problem should be adjusted

please lock it.
Title: Re: [help] EDIT cpp Chinese garbled!~!~!~!~
Post by: stahta01 on December 11, 2016, 08:50:30 pm
The question is:
build error:  failure to convert GBK to UTF-8

This is [likely] a Compiler error; NOT an Code::Blocks error!

Edit: No Idea if the normally suggested work around of using UTF-8 in the source code will work for Chinese.
But, if it does NOT then you need to find an Compiler the works with your GBK sourcecode.

Tim S.
Title: Re: [help] EDIT cpp Chinese garbled!~!~!~!~
Post by: lfjking on December 11, 2016, 09:14:03 pm
The question is:
build error:  failure to convert GBK to UTF-8

This is a Compiler error; NOT an Code::Blocks error!

Edit: No Idea if the normally suggested work around of using UTF-8 in the source code will work for Chinese.
But, if it does NOT then you need to find an Compiler the works with your GBK sourcecode.

Tim S.


I want to get rid of the unnecessary trouble.
So you can use system UTF-8 under window
Compile will go wrong...
Since it's GCC's fault.
Whether to provide a CodeBlocks conversion tool to match well
To know the code is different
Copy is a luxury
Title: Re: [help] EDIT cpp Chinese garbled!~!~!~!~
Post by: stahta01 on December 11, 2016, 09:18:38 pm
The question is:
build error:  failure to convert GBK to UTF-8

This is a Compiler error; NOT an Code::Blocks error!

Edit: No Idea if the normally suggested work around of using UTF-8 in the source code will work for Chinese.
But, if it does NOT then you need to find an Compiler the works with your GBK sourcecode.

Tim S.


I want to get rid of the unnecessary trouble.
So you can use system UTF-8 under window
Compile will go wrong...
Since it's GCC's fault.
Whether to provide a CodeBlocks conversion tool to match well
To know the code is different
Copy is a luxury

This site does NOT support any Compiler.
This site support only the Code::Blocks IDE.

Confirm it is a Compiler error on the command line; then if yes, look for another Compiler.
Or if you confirm it is NOT a compiler error, post more information in this thread.

If you think it is a Code::Blocks error, you need to post information on how to duplicate the problem for any chance that it will get fixed.

Tim S.
Title: Re: [help] EDIT cpp Chinese garbled!~!~!~!~
Post by: lfjking on December 11, 2016, 10:03:20 pm


This site does NOT support any Compiler.
This site support only the Code::Blocks IDE.

Confirm it is a Compiler error on the command line; then if yes, look for another Compiler.
Or if you confirm it is NOT a compiler error, post more information in this thread.

If you think it is a Code::Blocks error, you need to post information on how to duplicate the problem for any chance that it will get fixed.

Tim S.

Now I'm the way to solve the EideCode code is all changed to UTF-8
And then the project of all the documents encoded into UTF-8
All string plus _T
Code
//Other compiler options:  
-finput-charset=UTF-8
-fexec-charset=UTF-8
Encoding settings->use encoding when opening files: UTF-8

now , it can be successfully compiled successfully
Thank you