It's ok now, I used:
size_t pos;
while ((pos = temp.find(L"ș")) != std::string::npos)
{
temp.replace(pos, 2, L"s");
}
I try to see if this could be accomplished with std::replace
.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have the following std::string
:
Mureș
How can I replace the last UNICODE char to non-UNICODE ?
I have tried:
s = std::regex_replace(s, std::regex("ș"), "a");
but I got:
Unhandled exception at 0x75ECC3A2 in MyApp.exe: Microsoft C++ exception: std::regex_error at memory location 0x004FF450.
Beside of that, I have a warning:
warning C4566: character represented by universal-character-name '\u255A' cannot be represented in the current code page (1252)
It's ok now, I used:
size_t pos;
while ((pos = temp.find(L"ș")) != std::string::npos)
{
temp.replace(pos, 2, L"s");
}
I try to see if this could be accomplished with std::replace
.