Author Topic: [Solved] EDIT cpp Chinese garbled!~!~!~!~  (Read 3923 times)

Offline lfjking

  • Multiple posting newcomer
  • *
  • Posts: 17
[Solved] EDIT cpp Chinese garbled!~!~!~!~
« 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

« Last Edit: December 11, 2016, 10:05:25 pm by lfjking »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3297
Re: [help] EDIT cpp Chinese garbled!~!~!~!~
« Reply #1 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

Offline lfjking

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: [help] EDIT cpp Chinese garbled!~!~!~!~
« Reply #2 on: December 11, 2016, 07:47:40 pm »
The question is:
build error:  failure to convert GBK to UTF-8
 

Offline lfjking

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: [help] EDIT cpp Chinese garbled!~!~!~!~
« Reply #3 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.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7339
    • My Best Post
Re: [help] EDIT cpp Chinese garbled!~!~!~!~
« Reply #4 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.
« Last Edit: December 11, 2016, 09:14:22 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline lfjking

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: [help] EDIT cpp Chinese garbled!~!~!~!~
« Reply #5 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

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7339
    • My Best Post
Re: [help] EDIT cpp Chinese garbled!~!~!~!~
« Reply #6 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.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline lfjking

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: [help] EDIT cpp Chinese garbled!~!~!~!~
« Reply #7 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
« Last Edit: December 11, 2016, 10:08:12 pm by lfjking »