Giter Site home page Giter Site logo

Comments (4)

d-frey avatar d-frey commented on May 14, 2024

The overloads also need to be implemented, but our parser only supports UTF-8. I don't see any way to support this with reasonable effort. Plus JSON only requires support for UTF-8 anyways... hm...

@ColinH Any thoughts on this?

from json.

matbech avatar matbech commented on May 14, 2024

As an alternative: given a utf-8 encoded char* input, would it be possible to convert all value strings transparently from utf-8 to wstring?
The use case are Windows applications which for the majority work with wchar_t and not with utf-8 encoded strings.

from json.

d-frey avatar d-frey commented on May 14, 2024

Storing UTF-16 encoded strings (wstring or even wstring_view) would be a lot of work, starting with extending tao::json::type and adding support for the two additional types almost everywhere, extending the Events interface and forcing every producer and consumer to handle wstring, then adding comparisons for string vs. wstring because they are just a different representations of the same conceptual type, ... - sorry, that's not going to happen :)

💡 You could try and specialize the traits (or create your own traits) for std::wstring. That would allow you to use std::wstring almost seamlessly with our library.

❗️A specialization for wstring_view would probably not make much sense as the JSON value nodes store UTF-8 internally which can't be used by a wstring_view.

from json.

whiterabbit963 avatar whiterabbit963 commented on May 14, 2024

It should also be noted that std::wstring (wchar_t) gets compiled as 4 bytes on linux and 2 bytes on windows.

from json.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.