tgockel / json-voorhees

A killer modern C++ library for interacting with JSON.

Home Page:http://tgockel.github.io/json-voorhees/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Decode numeric encodings into arbitrarily encoded std::string

tgockel opened this issue · comments

Parsing outputs a UTF-8 encoded std::string from JSON numeric encodings (\uNNNN). This might not be what the user desires.

This is only on my radar because the workaround for this is so absurdly inconvenient for platforms that do not support output of UTF-8 encoded strings...the only workaround I can think of forces the user to convert at every string access à la convert_utf8_to_utf1(val.as_string()). That said, if every platform you'd use JsonVoorhees on supports UTF-8, this isn't worth dealing with. I'm going to wait until somebody actually cares about this to address it.

At a more general level: It might be completely pointless to support not-UTF-8 when the resultant string representation is the sequence of single bytes std::string. In Windows, where UCS-2 seems to be the norm for presentation, I should more to having strings be backed by std::wstring before addressing this sort of thing.