Codechange: use \u to indicate unicode chars in strings (#8379)
With \x, we sometimes had to do the "" trick, as the length is not predefined. With C++11 bringing \u to the specs, which has a preset length, we no longer need the "" trick. We set the strings to u8, to ensure all compilers use UTF-8 encoding for the \u characters. This was triggered by newer CLangs, which start to warn if you use "" in the middle of a string, wondering if that was your intention. It is a good question. And this is our answer :)
This commit is contained in:
@@ -505,7 +505,7 @@ static char *MakeFinnishTownName(char *buf, const char *last, uint32 seed)
|
||||
strstr(orig, "A") != nullptr || strstr(orig, "O") != nullptr || strstr(orig, "U") != nullptr) {
|
||||
buf = strecpy(buf, "la", last);
|
||||
} else {
|
||||
buf = strecpy(buf, "l\xC3\xA4", last);
|
||||
buf = strecpy(buf, u8"l\u00e4", last);
|
||||
}
|
||||
return buf;
|
||||
}
|
||||
|
Reference in New Issue
Block a user