8000 MNT: Use UTF-8 string in macosx backend by greglucas · Pull Request #23558 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

MNT: Use UTF-8 string in macosx backend #23558

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions src/_macosx.m
Original file line number Diff line number Diff line change
Expand Up @@ -716,10 +716,7 @@ static CGFloat _get_device_scale(CGContextRef cr)
if (!PyArg_ParseTuple(args, "s", &title)) {
return NULL;
}
NSString* ns_title = [[NSString alloc]
initWithCString: title
encoding: NSUTF8StringEncoding];
[self->window setTitle: ns_title];
[self->window setTitle: [NSString stringWithUTF8String: title]];
Py_RETURN_NONE;
}

Expand Down Expand Up @@ -946,10 +943,8 @@ -(void)save_figure:(id)sender { gil_call_method(toolbar, "save_figure"); }
rect.origin.y = 0.5*(height - rect.size.height);

for (int i = 0; i < 7; i++) {
NSString* filename = [NSString stringWithCString: images[i]
encoding: NSUTF8StringEncoding];
NSString* tooltip = [NSString stringWithCString: tooltips[i]
encoding: NSUTF8StringEncoding];
NSString* filename = [NSString stringWithUTF8String: images[i]];
NSString* tooltip = [NSString stringWithUTF8String: tooltips[i]];
NSImage* image = [[NSImage alloc] initWithContentsOfFile: filename];
buttons[i] = [[NSButton alloc] initWithFrame: rect];
[image setSize: size];
Expand Down
0