Skip to content

websocket_client and json::value are oil and water on Windows #1349

@DHowett-MSFT

Description

@DHowett-MSFT
  • websocket_client allows you to receive message bodies as streams of uint8_t or as std::strings, which are both utf-8 (also, per specification, the only valid encoding for JSON is utf-8)
  • json::value::parse allows you to pass utility::string_t or utility::istream_t, which on Windows are typedef'd to wstring and basic_stream<wchar_t> (wistream) and therefore utf-16 (also, per specification, the only valid encoding for JSON is utf-8)

Without jumping through hoops, it is practically impossible to receive a message from a websocket client and parse it as JSON.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions