[Boost-bugs] [Boost C++ Libraries] #12787: how to read non-utf8 strings with boost::property_tree

Subject: [Boost-bugs] [Boost C++ Libraries] #12787: how to read non-utf8 strings with boost::property_tree
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-01-25 09:09:24


#12787: how to read non-utf8 strings with boost::property_tree
------------------------------+---------------------------
 Reporter: steinbac@… | Owner: cornedbee
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: property_tree
  Version: Boost 1.61.0 | Severity: Showstopper
 Keywords: |
------------------------------+---------------------------
 Hi,
 I am having this problem with boost::property_tree::read_json since 1.59!
 My json tree looks like this (code attached):


 {{{
 static std::string reduced("{\n \"pipename\":
 \"quantiser(decode_lut_string=<verbatim>\\u0000@\\u0000\200\\u0000<\\/verbatim>)\",\n
 \"raw\": {\n \"type\": \"t\",\n \"rank\": \"3\",\n
 \"shape\": {\n \"dim\": \"256\",\n \"dim\":
 \"128\",\n \"dim\": \"128\"\n }\n },\n
 \"encoded\": {\n \"bytes\": \"4194304\"\n }\n}\n",296);
 }}}

 If you check, there is a section between <verbatim>..</verbatim> that I'd
 like to parse as is. the read_json method however throws an exception
 saying that:

 {{{
 <unspecified file>(4): invalid code sequence
 }}}

 my guess is, that the characters quoted above are non-utf8 and hence
 property_tree throws. Is this a bug or a feature?

 if it is a feature, i.e. property_tree is meant to only yield utf8 encoded
 strings, how would I store an arbitrary string in the property tree? NB.
 the string above works with boost 1.58 and older!

 Best,
 P

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12787>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:20 UTC