diff options
author | bunnei <bunneidev@gmail.com> | 2014-12-20 17:59:18 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2014-12-20 17:59:18 +0100 |
commit | 2b0d7a1d293ca28f6a9022b220720bf8b57a47e8 (patch) | |
tree | 363f962b88f1b3c8b4f9f36ad46dd3b10addde6b /src/core/file_sys | |
parent | Merge pull request #317 from yuriks/make_unique (diff) | |
parent | Clean up some warnings (diff) | |
download | yuzu-2b0d7a1d293ca28f6a9022b220720bf8b57a47e8.tar yuzu-2b0d7a1d293ca28f6a9022b220720bf8b57a47e8.tar.gz yuzu-2b0d7a1d293ca28f6a9022b220720bf8b57a47e8.tar.bz2 yuzu-2b0d7a1d293ca28f6a9022b220720bf8b57a47e8.tar.lz yuzu-2b0d7a1d293ca28f6a9022b220720bf8b57a47e8.tar.xz yuzu-2b0d7a1d293ca28f6a9022b220720bf8b57a47e8.tar.zst yuzu-2b0d7a1d293ca28f6a9022b220720bf8b57a47e8.zip |
Diffstat (limited to 'src/core/file_sys')
-rw-r--r-- | src/core/file_sys/archive_backend.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/core/file_sys/archive_backend.h b/src/core/file_sys/archive_backend.h index 18c314884..d7959b2ca 100644 --- a/src/core/file_sys/archive_backend.h +++ b/src/core/file_sys/archive_backend.h @@ -143,7 +143,16 @@ public: case Char: return std::vector<u8>(string.begin(), string.end()); case Wchar: - return std::vector<u8>(u16str.begin(), u16str.end()); + { + // use two u8 for each character of u16str + std::vector<u8> to_return(u16str.size() * 2); + for (size_t i = 0; i < u16str.size(); ++i) { + u16 tmp_char = u16str.at(i); + to_return[i*2] = (tmp_char & 0xFF00) >> 8; + to_return[i*2 + 1] = (tmp_char & 0x00FF); + } + return to_return; + } case Empty: return {}; default: |