# HG changeset patch # User Matt Mackall # Date 2012-04-03 16:35:04 # Node ID f350021ee32ed22b8bd7d3211a8899df0e3d6552 # Parent 21b31e9c20f3617f47db8ebc91d1ccf60055aca5 config: discard UTF-8 BOM if found diff --git a/mercurial/config.py b/mercurial/config.py --- a/mercurial/config.py +++ b/mercurial/config.py @@ -115,6 +115,9 @@ class config(object): for l in data.splitlines(True): line += 1 + if line == 1 and l.startswith('\xef\xbb\xbf'): + # Someone set us up the BOM + l = l[3:] if cont: if commentre.match(l): continue