mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-24 00:03:11 +01:00
Refactor string conversion between RCT2 and UTF8
Use Win32 API for conversion on Windows for non-1252 code pages instead of built-in tables.
This commit is contained in:
committed by
Aaron van Geffen
parent
2512e4959c
commit
deaa60f8f1
@@ -37,17 +37,13 @@ utf8 * IStream::ReadString()
|
||||
|
||||
std::string IStream::ReadStdString()
|
||||
{
|
||||
std::vector<utf8> result;
|
||||
|
||||
std::string result;
|
||||
uint8 ch;
|
||||
while ((ch = ReadValue<uint8>()) != 0)
|
||||
{
|
||||
result.push_back(ch);
|
||||
}
|
||||
result.push_back(0);
|
||||
|
||||
std::string resultString(result.data(), result.data() + result.size());
|
||||
return resultString;
|
||||
return result;
|
||||
}
|
||||
|
||||
void IStream::WriteString(const utf8 * str)
|
||||
|
||||
Reference in New Issue
Block a user