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] EDIT cpp Chinese garbled!~!~!~!~

Started by lfjking, December 11, 2016, 01:53:22 PM

Previous topic - Next topic

lfjking

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


BlueHazzard

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

lfjking

The question is:
build error:  failure to convert GBK to UTF-8


lfjking

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.

stahta01

#4
Quote from: lfjking on December 11, 2016, 07:47:40 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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

lfjking

Quote from: stahta01 on December 11, 2016, 08:50:30 PM
Quote from: lfjking on December 11, 2016, 07:47:40 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

stahta01

Quote from: lfjking on December 11, 2016, 09:14:03 PM
Quote from: stahta01 on December 11, 2016, 08:50:30 PM
Quote from: lfjking on December 11, 2016, 07:47:40 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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

lfjking

#7
Quote from: lfjking on December 11, 2016, 07:47:40 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

//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