Converts an array of wide chars to a narrow string using the UTF-8 encoding, and streams the result to the given Message object.
| 1216 | // Converts an array of wide chars to a narrow string using the UTF-8 |
| 1217 | // encoding, and streams the result to the given Message object. |
| 1218 | static void StreamWideCharsToMessage(const wchar_t* wstr, size_t length, |
| 1219 | Message* msg) { |
| 1220 | for (size_t i = 0; i != length;) { // NOLINT |
| 1221 | if (wstr[i] != L'\0') { |
| 1222 | *msg << WideStringToUtf8(wstr + i, static_cast<int>(length - i)); |
| 1223 | while (i != length && wstr[i] != L'\0') i++; |
| 1224 | } else { |
| 1225 | *msg << '\0'; |
| 1226 | i++; |
| 1227 | } |
| 1228 | } |
| 1229 | } |
| 1230 | |
| 1231 | #endif // GTEST_HAS_STD_WSTRING |
| 1232 |
no test coverage detected