Re: [Boost-bugs] [Boost C++ Libraries] #5033: Property Tree JSON Parser cannot handle utf-8 string correctly.

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #5033: Property Tree JSON Parser cannot handle utf-8 string correctly.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-09-17 17:21:31


#5033: Property Tree JSON Parser cannot handle utf-8 string correctly.
----------------------------------------------+-----------------------------
  Reporter: Lorin Liu <liu.lorin@…> | Owner: cornedbee
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: property_tree
   Version: Boost 1.45.0 | Severity: Problem
Resolution: | Keywords:
----------------------------------------------+-----------------------------

Comment (by Ilya Bobyr <ilya.bobyr@…>):

 While it is true, that char can not handle whole Unicode, it can still
 handle values larger than 0x7F if you view it as an unsigned integer.
 There was a fix for JSON writer in version 1.45 that makes it
 unconditionally view character type as unsigned thus allowing it to save
 UTF-8 encoded strings even if char is signed.
 Here is a similar patch for the JSON reader. While it still has
 std::min() in there it uses maximum value for unsigned char when clamping
 a character value been read.

 This way JSON writer and JSON reader are doing the same kind of
 transformation to the characters and UTF-8 encoded strings can go through
 a full save/load cycle.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5033#comment:5>
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:10 UTC