IDE編輯器編碼配置

來源:互聯網
上載者:User

標籤:io   使用   檔案   sp   問題   on   c   line   new   

 

做跨平台開發時,大家用不同的IDE合作開發,最令人頭疼的事就是各種亂碼問題。

常用的IDE都支援utf-8編碼和unix格式行尾‘\n‘。


1、XCODE設定文本編碼及換行
Xcode >> Preferences == Text Editing — Editing:
其下有Default text encoding 和default line endings.

2、Eclipse設定文本編碼及換行

Menu >> Preferences == General >> Workspace — 配置頁面
相中有Text file encoding 和New text file line delimiter.

3、Visual Studio
沒有找到直接處理的方法,以下是折衷的方式。
Tools -> Options -> Environment -> Documents -> Save document as Unicode when data cannot be saved in codepage 儲存時存為Unicode,勾選

Tools -> Options -> Text Editor -> General -> Auto-detect UTF-8 encoding without signature
開啟UTF-8編碼的檔案,勾選(說明:Xcode儲存文本時不加檔案頭的編碼標記,vs開啟這些檔案時就可能亂碼)

vs下開啟utf-8編碼的檔案儲存時會保持原編碼。只需要確保建立的檔案為utf-8:
建立檔案後,可以使用檔案的進階儲存選項,指定utf-8編碼及行尾即可。

IDE編輯器編碼配置

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.