GCC converting to execution Character Set: Invalid or incomplete multi-byte or wide character

Source: Internet
Author: User

Now I want to display Chinese Characters in Linux

The Code is as follows:

# Include <clocale> # include <cwchar> void optionversion () {wchar_t wstr [] = l "Simplified Chinese version by Master♂Luo Yun "; wprintf (L" % ls ", wstr); exit (0 );}

Error converting to execution Character Set: Invalid or incomplete multi-byte or wide character.

No solution was found for Internet queries.

We found that the GCC or G ++ encoding needs to be specified.

For example, if my source file is GBK encoded, add the parameter-finput-charset = 'gbk'

Output Chinese, pleasing to the eye:

Luozhuang @ luozhuang-Virtual-machine ~ /Netbeansprojects/Onscripter-20121116cnlinux/Dist/release/GNU-Linux-x86 $. /onscripter-20121116cnlinux <init>: avifile release-0.7.48-120520-08: 05 -.. /src/configure <init>: available CPU flags: fpu vme de pse tsc msr pae mce cx8 APIC Sep mtrr pge mca cmov Pat limit 36 clflush dts mmx fxsr SSE sse2 ss nx rdtscp lm limit up limit pebs BTS xtopology limit <init>: 1995.53 MHz Intel (r) core (TM) i7-2630QM CPU @ 2.00 GHz processor detectedonscripter version 20120701 Simplified Chinese edition by Master Luo Yun (2.96) Can't open any of 0.txt, 00.txt, nscript. dat and nscript. ___ luozhuang @ luozhuang-Virtual-machine ~ /NET beansprojects/Onscripter-20121116cnlinux/Dist/release/GNU-Linux-x86 $

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.