Frage

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.

War es hilfreich?

Lösung

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.

Andere Tipps

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

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top