Should source code be saved in UTF-8 format

后端 未结 5 1455
醉酒成梦
醉酒成梦 2020-12-03 02:56

How important is it to save your source code in UTF-8 format?

Eclipse on Windows uses CP1252 character encoding by default. The CP1251 format means non UTF-8 charact

5条回答
  •  没有蜡笔的小新
    2020-12-03 03:13

    Important is at least that you need to be consistent with the encoding used to avoid herrings. Thus not, X here, Y there and Z elsewhere. Save source code in encoding X. Set code input to encoding X. Set code output to encoding X. Set characterbased FTP transfer to encoding X. Etcetera.

    Nowadays UTF-8 is a good choice as it covers every character the human world is aware of and is pretty everywhere supported. So, yes, I would set workspace encoding to it as well. I also use it so.

提交回复
热议问题