Mercurial > emacs
diff src/macmenu.c @ 58708:60340bd28043
* macmenu.c (add_menu_item): Fallback on MacRoman if encoding
menu text as UTF8 fails.
| author | Steven Tamm <steventamm@mac.com> |
|---|---|
| date | Wed, 01 Dec 2004 15:51:22 +0000 |
| parents | 05fe2d3ca439 |
| children | 4ad0594e1ac4 |
line wrap: on
line diff
--- a/src/macmenu.c Wed Dec 01 14:10:23 2004 +0000 +++ b/src/macmenu.c Wed Dec 01 15:51:22 2004 +0000 @@ -2267,6 +2267,14 @@ CFStringRef string = CFStringCreateWithCString (NULL, item_name, kCFStringEncodingUTF8); + if (string == NULL) + { + /* Failed to interpret as UTF8. Fall back to Mac Roman. + Maybe wv->name is corrupted? */ + string = CFStringCreateWithCString (NULL, item_name, + kCFStringEncodingMacRoman); + } + SetMenuItemTextWithCFString (menu, pos, string); CFRelease (string); }
