Converts an array of wide chars to a narrow string using the UTF-8 encoding, and streams the result to the given Message object.
| 886 | // Converts an array of wide chars to a narrow string using the UTF-8 |
| 887 | // encoding, and streams the result to the given Message object. |
| 888 | static void StreamWideCharsToMessage(const wchar_t* wstr, size_t length, |
| 889 | Message* msg) { |
| 890 | for (size_t i = 0; i != length; ) { // NOLINT |
| 891 | if (wstr[i] != L'\0') { |
| 892 | *msg << WideStringToUtf8(wstr + i, static_cast<int>(length - i)); |
| 893 | while (i != length && wstr[i] != L'\0') |
| 894 | i++; |
| 895 | } else { |
| 896 | *msg << '\0'; |
| 897 | i++; |
| 898 | } |
| 899 | } |
| 900 | } |
| 901 | |
| 902 | #endif // GTEST_HAS_STD_WSTRING || GTEST_HAS_GLOBAL_WSTRING |
| 903 |
no test coverage detected