Closed sabelka closed 3 years ago
Thanks for pointing out this issue. I am considering the reinterpret_cast as the quickest solution, but I'll play a little bit with other approaches. What I have also discovered is that VS2019 and Gcc work differently with UTF-8 on Windows. Seems that VS requires the C++ file to be UTF-8 encoded with BOM to work properly.
Fixed with the latest commit.
I know mailio uses CMAKE_CXX_STANDARD=17 but when I try to experiment with C++20 I get errors like the following when compiling the examples.
/home/rainer/src/mailio/examples/smtp_utf8_qp_msg.cpp:46:64: error: no matching function for call to ‘mailio::message::subject(const char8_t [52])’ 46 | msg.subject(u8"smtp utf8 quoted printable поÑÑка");
The problem is, that the type of u8 string literals changed in C++20 from char to char8_t.
Adding u8string overloads to
mailio::message::subject(const string&)
andmailio::mime::content(const string&)
would fix this error. Other possibilities how to handle this incompatibility between c++17 and 20 are proposed here: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1423r3.htmlWhat do you think?