diff options
| author | Steven Tamm | 2004-12-01 15:51:22 +0000 |
|---|---|---|
| committer | Steven Tamm | 2004-12-01 15:51:22 +0000 |
| commit | f86bdc80c496aee7c29675f05d3690cf2c128091 (patch) | |
| tree | c21bcd4136b4d710e7442fb8b0e740dadee8b2b1 /src/macmenu.c | |
| parent | bdbed949970b828b02ef8746543337968d89f83b (diff) | |
| download | emacs-f86bdc80c496aee7c29675f05d3690cf2c128091.tar.gz emacs-f86bdc80c496aee7c29675f05d3690cf2c128091.zip | |
* macmenu.c (add_menu_item): Fallback on MacRoman if encoding
menu text as UTF8 fails.
Diffstat (limited to 'src/macmenu.c')
| -rw-r--r-- | src/macmenu.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/macmenu.c b/src/macmenu.c index 007fab15eab..af24cfe237c 100644 --- a/src/macmenu.c +++ b/src/macmenu.c | |||
| @@ -2267,6 +2267,14 @@ add_menu_item (MenuHandle menu, widget_value *wv, int submenu, | |||
| 2267 | CFStringRef string = | 2267 | CFStringRef string = |
| 2268 | CFStringCreateWithCString (NULL, item_name, kCFStringEncodingUTF8); | 2268 | CFStringCreateWithCString (NULL, item_name, kCFStringEncodingUTF8); |
| 2269 | 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 | |||
| 2270 | SetMenuItemTextWithCFString (menu, pos, string); | 2278 | SetMenuItemTextWithCFString (menu, pos, string); |
| 2271 | CFRelease (string); | 2279 | CFRelease (string); |
| 2272 | } | 2280 | } |