| 353 | } |
| 354 | |
| 355 | static void GetByteMap(const char* str, const size_t utf8Length, |
| 356 | std::vector<size_t>* byteMap) { |
| 357 | if (byteMap->size() < utf8Length) { |
| 358 | byteMap->resize(utf8Length); |
| 359 | } |
| 360 | const char* pstr = str; |
| 361 | for (size_t i = 0; i < utf8Length; i++) { |
| 362 | (*byteMap)[i] = pstr - str; |
| 363 | pstr = NextChar(pstr); |
| 364 | } |
| 365 | } |
| 366 | |
| 367 | #ifdef _MSC_VER |
| 368 | static std::wstring GetPlatformString(const std::string& str) { |