Boost C++ Libraries: Ticket #8836: boost::property_tree and BOM https://svn.boost.org/trac10/ticket/8836 <p> boost::property_tree::ptree can't handle files with BOM (at least for UTF-8). </p> <pre class="wiki">#include &lt;boost/filesystem.hpp&gt; #include &lt;boost/property_tree/ini_parser.hpp&gt; #include &lt;cstdlib&gt; #include &lt;iostream&gt; int main() { try { boost::filesystem::path path("helper.ini"); boost::property_tree::ptree pt; boost::property_tree::read_ini(path.string(), pt); const std::string foo = pt.get&lt;std::string&gt;("foo"); std::cout &lt;&lt; foo &lt;&lt; '\n'; } catch (const boost::property_tree::ini_parser_error&amp; e) { std::cerr &lt;&lt; "An error occurred while reading config file: " &lt;&lt; e.what() &lt;&lt; '\n'; return EXIT_FAILURE; } catch (const boost::property_tree::ptree_bad_data&amp; e) { std::cerr &lt;&lt; "An error occurred while getting options from config file: " &lt;&lt; e.what() &lt;&lt; '\n'; return EXIT_FAILURE; } catch (const boost::property_tree::ptree_bad_path&amp; e) { std::cerr &lt;&lt; "An error occurred while getting options from config file: " &lt;&lt; e.what() &lt;&lt; '\n'; return EXIT_FAILURE; } catch (...) { std::cerr &lt;&lt; "Unknown error \n"; return EXIT_FAILURE; } } </pre><p> <strong>helper.ini</strong> </p> <p> foo=str </p> <p> <strong>Output</strong> </p> <p> An error occurred while getting options from config file: No such node (foo) </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8836 Trac 1.4.3