diff options
Diffstat (limited to 'src/macmenu.c')
| -rw-r--r-- | src/macmenu.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/macmenu.c b/src/macmenu.c index af24cfe237c..f0696a49774 100644 --- a/src/macmenu.c +++ b/src/macmenu.c | |||
| @@ -2264,17 +2264,8 @@ add_menu_item (MenuHandle menu, widget_value *wv, int submenu, | |||
| 2264 | item_name[255] = 0; | 2264 | item_name[255] = 0; |
| 2265 | #if TARGET_API_MAC_CARBON | 2265 | #if TARGET_API_MAC_CARBON |
| 2266 | { | 2266 | { |
| 2267 | CFStringRef string = | 2267 | CFStringRef string = cfstring_create_with_utf8_cstring (item_name); |
| 2268 | CFStringCreateWithCString (NULL, item_name, kCFStringEncodingUTF8); | 2268 | |
| 2269 | |||
| 2270 | if (string == NULL) | ||
| 2271 | { | ||
| 2272 | /* Failed to interpret as UTF8. Fall back to Mac Roman. | ||
| 2273 | Maybe wv->name is corrupted? */ | ||
| 2274 | string = CFStringCreateWithCString (NULL, item_name, | ||
| 2275 | kCFStringEncodingMacRoman); | ||
| 2276 | } | ||
| 2277 | |||
| 2278 | SetMenuItemTextWithCFString (menu, pos, string); | 2269 | SetMenuItemTextWithCFString (menu, pos, string); |
| 2279 | CFRelease (string); | 2270 | CFRelease (string); |
| 2280 | } | 2271 | } |