Converts an array of wide chars to a narrow string using the UTF-8 encoding, and streams the result to the given Message object.
| 2408 | // Converts an array of wide chars to a narrow string using the UTF-8 |
| 2409 | // encoding, and streams the result to the given Message object. |
| 2410 | static void StreamWideCharsToMessage(const wchar_t* wstr, size_t length, |
| 2411 | Message* msg) { |
| 2412 | for (size_t i = 0; i != length; ) { // NOLINT |
| 2413 | if (wstr[i] != L'\0') { |
| 2414 | *msg << WideStringToUtf8(wstr + i, static_cast<int>(length - i)); |
| 2415 | while (i != length && wstr[i] != L'\0') |
| 2416 | i++; |
| 2417 | } else { |
| 2418 | *msg << '\0'; |
| 2419 | i++; |
| 2420 | } |
| 2421 | } |
| 2422 | } |
| 2423 | |
| 2424 | #endif // GTEST_HAS_STD_WSTRING |
| 2425 |
no test coverage detected