Closed BrainStone closed 5 years ago
This is indeed not supported in the moment. What would be the encoding of the characters in the stream? UTF-16?
I cannot really answer the question. Though my guess would be UTF-8.
I cannot answer it with 100% certainty because it is the stream type the https://github.com/zuhd-org/easyloggingpp library uses. Though I think they just use UTF-8. Especially considering I can use .dump()
just fine.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Great to see this dying due to inactivity.
Sorry, but this is a part-time project. And for this issue it’s not even clear what to do.
The simplest solution would be to just stream a string object into it. I mean wstreams need to be able to handle that themselves. And if they don't that's not your problem.
But in order to do this, the characters of type char
have to be converted to wchar
. And this conversion would also involve encoding: how would an UTF-8 string be recoded to a sequence of wchar
?
No. You can stream char
s just fine into a "wstream
".
http://cpp.sh/2u7wa
Technically, anything can be converted to anything. But:
But in order to do this, the characters of type
char
have to be converted towchar
. And this conversion would also involve encoding: how would an UTF-8 string be recoded to a sequence ofwchar
?
I do not think such a conversion should be part of the API of the library - if needed, user code should do it, because only this code knows what a sequence of wchar
should mean in this setting.
Again, you don't need to convert anything. Normal char
based strings are just fine. Because then the stream is obligated to do the correct conversion.
It is not possible to directly stream a json object into a
std::basic_stringstream<wchar_t>
.Please describe the steps to reproduce the issue. Can you provide a small but working code example?
Try to stream an
json
object into astd::basic_stringstream<wchar_t>
(Not) working minimal example: https://wandbox.org/permlink/UPTfYGpCkteUSbDx
That the required operator overload exists, so it can be streamed into a
std::basic_stringstream<wchar_t>
like it can into astd::basic_stringstream<char>
The operator overload is missing resulting in a complier error.
GCC 8.3 on Debian 10 (and yes, it is supported according to the link)
develop
branch?Using version 3.6.1