On Thu, May 15, 2014 at 3:10 AM, Damien O'Rourke <damien@enmessage.com> wrote:

have come across this situation when parsing and de-parsing a JSON
structure, using Yaws 1.96 and 1.98

1. The incoming file to be parsed had this as part of it's structure ...
note the unicode character
     \"origfilename\":\"Acronyms \\u2013 April 2014.pptx\"

2. The JSON structure was parsed through json2:decode-string and the
\u2013 (EN-DASH) was converted to UTF-32 (or UTF-16) char 8211

3. The element containing that char was then run through json2:encode
... to send on but a bad character exception is thrown at that 8211

Is there someway that I've missed which decodes and encode this
correctly, or is this a know bug or limitation?

I'd say it's a bug. The json2 module recognizes the \u sequence and just converts the hex value into a decimal character equivalent, but I think what it should do is encode the value as utf-8.