문제

I am starting out on a new project, and I want to know what encoding I should choose for my code files.

I am writing a web app in Python + JavaScript + HTML + CSS on Linux, and my code editors Notepad++ and KomodoEdit give me some options:

  • Encode in ANSI
  • Encode in UTF-8 without BOM
  • Encode in UTF-8

I am not sure which encoding should I choose.

도움이 되었습니까?

해결책

The answer could depend upon the operating system and versions of software (in particular, version of Python) you are using, but I would choose "Encode in UTF-8 without BOM"

In practice I would avoid using non-ASCII characters in source code. If you need them, use them only in string literals and in comments.

Avoid having them in identifiers.

다른 팁

Better use UTF-8 as its a web application, the UTF-8 support almost all the browsers and operating systems.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top