Mercurial: which config property controls the encoding of file contents? -
is there dedicated mercurial configuration property specifies encoding of file contents , hence should used mercurial client display file?
i've found web.encoding
not seem mean i'm looking for. also, google gave results ui.encoding
well, couldn't find hints in reference.
mercurial not concerned encoding of files put in repository: mercurial happy store files encoding (or maybe not particular encoding @ all).
this means can add files utf-8, latin-1, or other encoding repository , mercurial check them out when added them.
the encoding of each file not stored anywhere in mercurial , client recognize encoding (perhaps based on file content makes sense, e.g., xml files).
for mercurial desktop client (as per comments below) suggest looking @ file content:
- can decode @ utf-16?
- can decode utf-8?
- are
nul
bytes in file? stop , declare "binary". - fallback on latin-n encoding such latin-1 western europe.
the utf-16 , utf-8 encodings nice since structured , makes possible detect file isn't valid utf-8 encoded, say. above list written european perspective — should consult knowledge shift jis , other encodings used in asia.
in case, expect mercurial client best effort attempt @ showing me file encoding other ascii.
some alternative interpretations of question:
if you're asking how make files "correct" when view them in
hgweb
, it's matter of using consistent encoding in repository , setting `web.encoding.if you're asking how ensure text files os native line ending character on different platforms (
\n
on unix,\r\n
on windows) when take @ eol extension comes mercurial.
Comments
Post a Comment