diff options
Diffstat (limited to 'lang/cpp/src')
-rw-r--r-- | lang/cpp/src/context.cpp | 2 | ||||
-rw-r--r-- | lang/cpp/src/editinteractor.cpp | 4 | ||||
-rw-r--r-- | lang/cpp/src/error.h | 5 |
3 files changed, 7 insertions, 4 deletions
diff --git a/lang/cpp/src/context.cpp b/lang/cpp/src/context.cpp index 4882c80c..8150d08b 100644 --- a/lang/cpp/src/context.cpp +++ b/lang/cpp/src/context.cpp @@ -195,7 +195,7 @@ Error Error::fromCode(unsigned int err, unsigned int src) std::ostream &operator<<(std::ostream &os, const Error &err) { - return os << "GpgME::Error(" << err.encodedError() << " (" << err.asString() << "))"; + return os << "GpgME::Error(" << err.encodedError() << " (" << err.asStdString() << "))"; } Context::KeyListModeSaver::KeyListModeSaver(Context *ctx) diff --git a/lang/cpp/src/editinteractor.cpp b/lang/cpp/src/editinteractor.cpp index 72ed92f7..84ddf398 100644 --- a/lang/cpp/src/editinteractor.cpp +++ b/lang/cpp/src/editinteractor.cpp @@ -138,7 +138,7 @@ public: if (writeAll(fd, result, len) != len) { err = Error::fromSystemError(); if (ei->debug) { - std::fprintf(ei->debug, "EditInteractor: Could not write to fd %d (%s)\n", fd, err.asString()); + std::fprintf(ei->debug, "EditInteractor: Could not write to fd %d (%s)\n", fd, err.asStdString().c_str()); } goto error; } @@ -147,7 +147,7 @@ public: if (writeAll(fd, "\n", 1) != 1) { err = Error::fromSystemError(); if (ei->debug) { - std::fprintf(ei->debug, "EditInteractor: Could not write to fd %d (%s)\n", fd, err.asString()); + std::fprintf(ei->debug, "EditInteractor: Could not write to fd %d (%s)\n", fd, err.asStdString().c_str()); } goto error; } diff --git a/lang/cpp/src/error.h b/lang/cpp/src/error.h index bc970e36..000b562b 100644 --- a/lang/cpp/src/error.h +++ b/lang/cpp/src/error.h @@ -47,7 +47,10 @@ public: explicit Error(unsigned int e) : mErr(e), mMessage() {} const char *source() const; - const char *asString() const; + /* This function is deprecated. Use asStdString() instead. asString() may + * return wrongly encoded (i.e. not UTF-8) results on Windows for the main + * thread if the function was first called from a secondary thread. */ + GPGMEPP_DEPRECATED const char *asString() const; std::string asStdString() const; int code() const; |