当前位置:网站首页>Source insight garbled code solution
Source insight garbled code solution
2022-07-03 04:50:00 【llzhang_ fly】
【 reason 】:SI I won't support it UTF-8 Character coding garbled
Recently used source insight Check out some open source code , Chinese is garbled , because source insight I won't support it utf-8 code , The default encoding is ANSI code . So we need to utf-8 Such as the ANSI Code file conversion source insight Default supported ANSI Code format can display Chinese without garbled code .
【 problem 】
use Source Insight Open one C file , It contains Chinese in SI It's garbled in
【 To solve the process 】
1、 stay notePad++ Look at this file , yes UTF-8 Coded
2、 Try to make it display correctly UTF-8 Encoded Chinese characters :
find SI Explanation on the official website :
Source Insight 3.x Frequently Asked Questions
Q: Does Source Insight support UNICODE files?
A: Source Insight 3.x does not yet support UNICODE files.
namely SI 3.x actually , I won't support it Unicode
3、 take UTF-8 The source file , use Notepad++ take UTF-8 Convert the source file of to local ANSI, namely GB2312 code , here , Reuse SI open , You can display Chinese normally
For multiple files , Just want to make it display Chinese correctly , Here , For the time being, it can only be realized through code conversion .
About encoding conversion , In addition to using Notepad++ Tools such as , have access to iconv Tools to transform .
iconv The usage of is :
iconv -c -f utf-8 -t gb2312 BlogSohu_utf8.py >> BlogSohu_ansi_gb2312.py
【 Be careful 】 Because the code is Python Code , It is code sensitive , That is, it can't be arbitrarily converted to other codes , Otherwise, it will affect the execution of the code . Not to use SI Look at the code cool , But the Python The coding of the program has changed , Otherwise, the program cannot be executed normally , It's not worth it .
【 summary 】
Solution :
One 、 Single file conversion
For a single file , To say , As long as the non ANSI Code format file into ANSI Code format is ok , The method is as follows :
1、 The file with ultraEdit32 open , choice file -> transformation ->UTF-8 To ANSI, Then save . Reuse source insight Just open it .
Or use Notepad to open non ANSI Format of the source code file , Save as , In the save options dialog , It is found in the column of coding format that UTF-8, choice ANSI a , preservation , Reuse Source Insight Open it and you can normally display Chinese comments . For details, please refer to an article on Baidu experience :source insight The solution of Chinese random code .
2、 With the help of Linux Under the iconv command
(1) About iconv command reference , Can be in Linux Type iconv --help perhaps iconv --usage Check it out.
You can refer to this article :http://www.firekyrin.com/archives/249.html
You can use iconv Library function ( Included in glib in ) and iconv Command to perform encoding conversion , namely :
iconv -f utf-8 -t gb18030 file1.txt -o file2.txt
take utf-8 Coded file1.txt File conversion to gb18030 Coded file2.txt file .
source insight Chinese annotation for garbled code solution
(1)source insight read VC++ Source code , Comments are garbled solutions
1、options->preferences->Syntax Formatting->Styles;
2、 stay Style Name choice Comment, Again on its Font Name choice Pick, Then choose “ NSimSun ”.
(2)source insight read Linux Source code , Comments are garbled solutions
1、 Open source file with Notepad , Chinese can show , I save it as , In the Save option , The code column is :UTF-8. I chose ANSI a , preservation . Reuse Source Insight open , Finally, it can be shown .
边栏推荐
- SSM based campus part-time platform for College Students
- 2022 new examination questions for the main principals of hazardous chemical business units and examination skills for the main principals of hazardous chemical business units
- Crazy scientist
- Current market situation and development prospect prediction of global direct energy deposition 3D printer industry in 2022
- Hire cashier (differential constraint)
- Do you know UVs in modeling?
- Market status and development prospect prediction of global fermented plant protein industry in 2022
- document. The problem of missing parameters of referer is solved
- Preparation for school and professional cognition
- The simple problem of leetcode: dismantling bombs
猜你喜欢
[luatos sensor] 1 light sensing bh1750
On typescript and grammar
MC Layer Target
2022 tea master (intermediate) examination questions and tea master (intermediate) examination skills
2022 P cylinder filling test content and P cylinder filling simulation test questions
Mobile terminal - uniapp development record (public request encapsulation)
STM32 reverse entry
The programmer went to bed at 12 o'clock in the middle of the night, and the leader angrily scolded: go to bed so early, you are very good at keeping fit
First + only! Alibaba cloud's real-time computing version of Flink passed the stability test of big data products of the Institute of ICT
2022 Shandong Province safety officer C certificate examination content and Shandong Province safety officer C certificate examination questions and analysis
随机推荐
Market status and development prospect forecast of global button dropper industry in 2022
Market status and development prospect forecast of global heat curing adhesive industry in 2022
Symbol of array element product of leetcode simple problem
Market status and development prospects of the global automatic tea picker industry in 2022
2022 t elevator repair simulation examination question bank and t elevator repair simulation examination question bank
[set theory] binary relationship (definition field | value field | inverse operation | inverse synthesis operation | restriction | image | single root | single value | nature of synthesis operation)
Market status and development prospect prediction of global colorimetric cup cover industry in 2022
【PHP漏洞-弱类型】基础知识、php弱相等、报错绕过
ZABBIX monitoring of lamp architecture (3): zabbix+mysql (to be continued)
【工具跑SQL盲注】
2022 Shandong Province safety officer C certificate examination content and Shandong Province safety officer C certificate examination questions and analysis
Crazy scientist
SSM based campus part-time platform for College Students
Mount NFS in kubesphere
MediaTek 2023 IC written examination approved in advance (topic)
Career planning of counter attacking College Students
@RequestMapping
第十九届浙江省 I. Barbecue
Review the old and know the new: Notes on Data Science
Learning practice: comprehensive application of cycle and branch structure (I)