
Hi, I'm playing with new boost library property_tree. And I have several questions regarding it. 1) Suppose there is xml file with utf8 encoding. What is the best way to populate it into wptree? 2) How can I save wptree into xml file with utf8 encoding. Unfortunately write_xml requires wostream. 3) Is there something like map operator[]? I.e. I need the following behavior: wptree & something(some_path) { boost::optional<wptree &> child = my_tree.get_child(some_path); if(child) return child.get(); else return my_tree.put_child(some_path); } Best Regards, Sergei

On Wed, 2 Dec 2009 12:33:09 +0300, Sergei Politov <spolitov@gmail.com> wrote:
Hi,
I'm playing with new boost library property_tree. And I have several questions regarding it. 1) Suppose there is xml file with utf8 encoding. What is the best way to populate it into wptree?
Parse from a wistream that has been imbued with a locale containing a UTF-8 conversion facet, e.g. the one from Boost.Serialization.
2) How can I save wptree into xml file with utf8 encoding. Unfortunately write_xml requires wostream.
Same as above.
3) Is there something like map operator[]? I.e. I need the following behavior: wptree & something(some_path) { boost::optional<wptree &> child = my_tree.get_child(some_path); if(child) return child.get(); else return my_tree.put_child(some_path); }
I don't think there is such a thing available, but it sounds useful. I'll see about adding it. Sebastian

Sebastian, On Wed, Dec 2, 2009 at 3:53 PM, Sebastian Redl < sebastian.redl@getdesigned.at> wrote:
Parse from a wistream that has been imbued with a locale containing a UTF-8 conversion facet, e.g. the one from Boost.Serialization.
Unfortunately it does not work. RapidXML cannot parse wide strings
correctly.
Same as above.
Where can I find an example?
I don't think there is such a thing available, but it sounds useful. I'll see about adding it.
Thanks. Best Regards, Sergei
participants (2)
-
Sebastian Redl
-
Sergei Politov