]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Ignore UTF-8 byte order mark
authorHeiko Hund <heiko.hund@sophos.com>
Mon, 4 Feb 2013 11:39:25 +0000 (11:39 +0000)
committerDavid Sommerseth <davids@redhat.com>
Wed, 6 Feb 2013 19:10:09 +0000 (20:10 +0100)
commita8fe779b04cc5bf698a1bf5bed4b0189126c3a38
tree4ef66f0c0042271aa6b8a98882128c5f312bfc19
parent901f647ddbd771086814b9ca050e166182fb3371
Ignore UTF-8 byte order mark

Currently openvpn exits when reading configuration from a file
that has an UTF-8 byte order mark (EF BB BF) at its start.

While it is useless to put a BOM into UTF-8 encoded files, the
Unicode standard [1] permits it (on page 36):

  "Use of a BOM is neither required nor recommended for UTF-8,
  but may be encountered in contexts where UTF-8 data is converted
  from other encoding forms that use a BOM or where the BOM is
  used as a UTF-8 signature."

Notepad.exe, the default text editor on Windows, always puts the BOM
into UTF-8 encoded files when saving them. Others may do as well.

Just ignoring the UTF-8 BOM will make config files with UTF-8 BOM
readable.

[1] http://www.unicode.org/versions/Unicode5.0.0/ch02.pdf

Signed-off-by: Heiko Hund <heiko.hund@sophos.com>
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: 1359977966-31724-1-git-send-email-heiko.hund@sophos.com
URL: http://article.gmane.org/gmane.network.openvpn.devel/7342
Signed-off-by: David Sommerseth <davids@redhat.com>
(cherry picked from commit 6e6f55f4ba5deda5649679a13e4e323e07b3e661)
src/openvpn/options.c