当前位置:网站首页>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 .
边栏推荐
- Network security textual research recommendation
- Introduction to JVM principle
- Internationalization and localization, dark mode and dark mode in compose
- Matplotlib -- save graph
- Human resource management system based on JSP
- Small sample target detection network with attention RPN and multi relationship detector (provide source code, data and download)
- Hj35 serpentine matrix
- MPM model and ab pressure test
- 雇佣收银员(差分约束)
- Wechat applet waterfall flow and pull up to the bottom
猜你喜欢

Keepalived热备与HAProxy

The reason why the entity class in the database is changed into hump naming

Review the old and know the new: Notes on Data Science

ZABBIX monitoring of lamp architecture (3): zabbix+mysql (to be continued)

Sdl2 + OpenGL glsl practice (Continued)

String matching: find a substring in a string

Human resource management system based on JSP

Do you know UVs in modeling?

Retirement plan fails, 64 year old programmer starts work again

逆袭大学生的职业规划
随机推荐
LVS load balancing cluster of efficient multi-purpose cluster (NAT mode)
data2vec! New milestone of unified mode
MediaTek 2023 IC written examination approved in advance (topic)
普通本科大学生活避坑指南
On typescript and grammar
[set theory] binary relationship (binary relationship notation | binary relationship from a to B | number of binary relationships | example of binary relationship)
4 years of experience to interview test development, 10 minutes to end, ask too
Market status and development prospect prediction of the global fire hose industry in 2022
[PCL self study: filtering] introduction and use of various filters in PCL (continuously updated)
Market status and development prospect prediction of global SoC Test Platform Industry in 2022
MySQL winter vacation self-study 2022 12 (3)
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
Leetcode simple question: the key with the longest key duration
Hire cashier (differential constraint)
移动端——uniapp开发记录(公共请求request封装)
Use Sqlalchemy module to obtain the table name and field name of the existing table in the database
Market status and development prospect prediction of the global forward fluorescent microscope industry in 2022
Truncated sentences of leetcode simple questions
[set theory] binary relation (example of binary relation on a | binary relation on a)
Network security textual research recommendation