mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-18 07:53:12 +00:00
SDL: Modified OSystem_SDL::setWindowCaption to strip out non-ASCII chars (this prevents a crash on OS X). Note that the OSystem specs cleary state that only ASCII may be passed to setWindowCaption(), but we ignore this e.g. in the launcher
svn-id: r40381
This commit is contained in:
parent
1c50778e46
commit
c38c0980cd
@ -396,7 +396,14 @@ Common::WriteStream *OSystem_SDL::createConfigWriteStream() {
|
||||
}
|
||||
|
||||
void OSystem_SDL::setWindowCaption(const char *caption) {
|
||||
SDL_WM_SetCaption(caption, caption);
|
||||
Common::String cap(caption);
|
||||
|
||||
// Filter out any non-ASCII characters, replacing them by question marks.
|
||||
// At some point, we may wish to allow LATIN 1 or UTF-8.
|
||||
for (uint i = 0; i < cap.size(); ++i)
|
||||
if ((byte)cap[i] > 0x7F)
|
||||
cap.setChar('?', i);
|
||||
SDL_WM_SetCaption(cap.c_str(), cap.c_str());
|
||||
}
|
||||
|
||||
bool OSystem_SDL::hasFeature(Feature f) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user