Re:UTF-8 Everywhere (2012)
by ybungalobill on Monday June 20, 2016 @10:32AM
(#11938263)
The standard does not specify what the standard exceptions return from what(). It does not have to be in English.
Why care about it's prototype? You may want to embed into what() unicode strings that describe the error and came from elsewhere. E.g. a path, a URL, an XML element id, etc. from the context the exception originated. It may be shown to the user or written to the log. Localization is irrelevant here.
If you rely on std::exception::what() while building a localizable software, you’ll end with inconsistent GUI language. Because some exceptions (that are part of STL) will return English messages, other exceptions (that aren’t part of STL) will return non-English messages.
This means if you’re developing anything localizable, you can’t rely on std::exception::what().
Then why care about it’s prototype?