aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/stubs/io_win32.h
diff options
context:
space:
mode:
authorGravatar Jisi Liu <jisi.liu@gmail.com>2018-01-03 09:28:40 -0800
committerGravatar Jisi Liu <jisi.liu@gmail.com>2018-01-03 09:28:40 -0800
commit383a4941d5b1aa3c0afbdc24dd0e5d63d263fc3a (patch)
tree45bdce007f64e47ff2a0b60fb1920efc3eaf3b00 /src/google/protobuf/stubs/io_win32.h
parent8529f2aee33ae793c9ce362a45370b98f675370a (diff)
parent88e5573b9a8a5c4038f9db3633610f032aab277d (diff)
Merge remote-tracking branch 'origin/3.5.x' into master
Diffstat (limited to 'src/google/protobuf/stubs/io_win32.h')
-rw-r--r--src/google/protobuf/stubs/io_win32.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/google/protobuf/stubs/io_win32.h b/src/google/protobuf/stubs/io_win32.h
index 53160089..9e17d253 100644
--- a/src/google/protobuf/stubs/io_win32.h
+++ b/src/google/protobuf/stubs/io_win32.h
@@ -69,8 +69,25 @@ LIBPROTOBUF_EXPORT int read(int fd, void* buffer, size_t size);
LIBPROTOBUF_EXPORT int setmode(int fd, int mode);
LIBPROTOBUF_EXPORT int stat(const char* path, struct _stat* buffer);
LIBPROTOBUF_EXPORT int write(int fd, const void* buffer, size_t size);
-LIBPROTOBUF_EXPORT std::wstring testonly_path_to_winpath(
- const std::string& path);
+LIBPROTOBUF_EXPORT std::wstring testonly_utf8_to_winpath(const char* path);
+
+namespace strings {
+
+// Convert from UTF-16 to Active-Code-Page-encoded or to UTF-8-encoded text.
+LIBPROTOBUF_EXPORT bool wcs_to_mbs(
+ const wchar_t* s, std::string* out, bool outUtf8);
+
+// Convert from Active-Code-Page-encoded or UTF-8-encoded text to UTF-16.
+LIBPROTOBUF_EXPORT bool mbs_to_wcs(
+ const char* s, std::wstring* out, bool inUtf8);
+
+// Convert from UTF-8-encoded text to UTF-16.
+LIBPROTOBUF_EXPORT bool utf8_to_wcs(const char* input, std::wstring* out);
+
+// Convert from UTF-16-encoded text to UTF-8.
+LIBPROTOBUF_EXPORT bool wcs_to_utf8(const wchar_t* input, std::string* out);
+
+} // namespace strings
} // namespace win32
} // namespace internal