Author: Ilya Bobyr <ilya.bobyr@gmail.com>
Date: Mon Sep 17 09:44:50 2012 -0700
[B] Boost.PropertyTree: Correctly read UTF-8
Boost.PropertyTree has a fix in version 1.45 to write narrow characters, in
case char is signed, with highest bit set correctly. This this a similar
fix for the read side.
a
|
b
|
namespace boost { namespace property_tree { namespace json_parser
|
145 | 145 | a_unicode(context &c): c(c) { } |
146 | 146 | void operator()(unsigned long u) const |
147 | 147 | { |
148 | | u = (std::min)(u, static_cast<unsigned long>((std::numeric_limits<Ch>::max)())); |
| 148 | typedef typename make_unsigned<Ch>::type UCh; |
| 149 | u = (std::min)(u, static_cast<unsigned long>((std::numeric_limits<UCh>::max)())); |
149 | 150 | c.string += Ch(u); |
150 | 151 | } |
151 | 152 | }; |