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: 2011-12-01 08:01:19


#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 Tommy):

 Replying to [comment:2 rshhh <ryushiro.sugehara@…>]:
> I think the approach taken in the patch is not correct. \\
> Since a single byte of UTF-8 string could take a value larger than the
 maximum that '''''signed char''''' could take(0x7F), I think that certain
 characters may overflow a '''''Ch''''' (or just '''''char''''') object. \\
> I'm guessing that the issue I just wrote is exactly the reason why the
 original code is taking std::min() approach, am I correct? So if my
 opinion is right, I think we should store the UTF-8 character in a
 '''''unsigned char''''' sequence...

 I think the problem is : a_unicode SHOULD handle a unicode char, which
 can't fit in a Ch (or just char).
 Should mbrtowc()/wcrtomb() be used to convert between unicode(wchar_t) and
 Ch?

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