Use UTF-8 strings. Sometimes +[NSString stringWithUTF8String:] returns nil (I have no idea why), so use an empty string in that case.
This commit is contained in:
@@ -55,7 +55,9 @@ void DisposeOfCocoaWindow()
|
||||
|
||||
void SetCocoaWindowText(const char *s)
|
||||
{
|
||||
[text setString:[NSString stringWithCString:s]];
|
||||
NSString *str = [NSString stringWithUTF8String:s];
|
||||
|
||||
[text setString:(str ? str : @"" )];
|
||||
[text display];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user