mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-04 02:41:19 +00:00
Initialize string_view with explicit size
Otherwise size is detected by null terminating character.
This commit is contained in:
parent
d680870e8f
commit
b96c41df07
@ -57,13 +57,13 @@ namespace
|
||||
switch (sourceEncoding)
|
||||
{
|
||||
case ToUTF8::WINDOWS_1252:
|
||||
return ToUTF8::windows_1252;
|
||||
return {ToUTF8::windows_1252, std::size(ToUTF8::windows_1252)};
|
||||
case ToUTF8::WINDOWS_1250:
|
||||
return ToUTF8::windows_1250;
|
||||
return {ToUTF8::windows_1250, std::size(ToUTF8::windows_1250)};
|
||||
case ToUTF8::WINDOWS_1251:
|
||||
return ToUTF8::windows_1251;
|
||||
return {ToUTF8::windows_1251, std::size(ToUTF8::windows_1251)};
|
||||
case ToUTF8::CP437:
|
||||
return ToUTF8::cp437;
|
||||
return {ToUTF8::cp437, std::size(ToUTF8::cp437)};
|
||||
}
|
||||
throw std::logic_error("Invalid source encoding: " + std::to_string(sourceEncoding));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user