6-13 4,062 views
一、文本出现中文乱码问题
1、打开Sublime Text 3,按Ctrl+~打开控制行,复制粘贴以下python代码,然后回车运行。
- 复制并粘贴如下代码:
<div id="" class="dp-highlighter"> <div class="bar"> <div class="tools">Python代码 <embed src="http://heipark.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf" type="application/x-shockwave-flash" width="14" height="15"></embed> <a title="收藏这段代码"><img class="star" src="http://heipark.iteye.com/images/icon_star.png" alt="收藏代码" /></a></div> </div> <ol class="dp-py" start="1"> <li><span class="keyword">import</span> urllib.request,os,sys; <span class="keyword">exec</span>(<span class="string">"if sys.version_info < (3,) or os.name != 'nt': raise OSError('This code is for Windows ST3 only!')"</span>); pr=<span class="string">'Preferences.sublime-settings'</span>; ip=<span class="string">'ignored_packages'</span>; n=<span class="string">'Package Control'</span>; s=sublime.load_settings(pr); ig=s.get(ip); ig.append(n); s.set(ip,ig); sublime.save_settings(<span class="string">'Preferences.sublime-settings'</span>); pf=n+<span class="string">'.sublime-package'</span>; urllib.request.install_opener(urllib.request.build_opener(urllib.request.ProxyHandler())); by=urllib.request.urlopen(<span class="string">'https://packagecontrol.io/'</span>+pf.replace(<span class="string">' '</span>,<span class="string">'%20'</span>)).read(); open(os.path.join(sublime.installed_packages_path(),pf),<span class="string">'wb'</span>).write(by); ig.remove(n); s.set(ip,ig); sublime.save_settings(pr); <span class="keyword">print</span>(<span class="string">'Package Control: 3.0.0 upgrade successful!'</span>)</li> </ol> </div> <h6>2、重启Sublime Text 3。</h6> <h6><a name="t7"></a>3、按Ctrl+Shift+P打开命令行,输入Install Package,回车,然后继续输入ConvertToUTF8,回车。</h6> <h6><a name="t8"></a>等安装好了以后,应该问题就解决了,如果还是不行,再按照安装ConvertToUTF8的方式安装GBK Encoding Support,就好了。</h6>
转自:http://blog.csdn.net/china_chenxing/article/details/18841641 (亲试有效)
二、tab中文出现方块问题:
在sublime text 3中,Preference, Settings-User,添加:
写道
“dpi_scale”: 1.0,
我的Settings-User配置:
<div class="quote_title">写道</div>
<div class="quote_div">{
"dpi_scale": 1.0,
"font_face": "Consolas",
"font_size": 17,
"ignored_packages":
[
"Vintage"
],
"line_padding_bottom": 1,
"line_padding_top": 1,
"tab_size": 4,
"translate_tabs_to_spaces": true,
"word_wrap": "true"
}</div>
--end