+2004-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * macmenu.c (add_menu_item): Fallback on MacRoman if encoding
+ menu text as UTF8 fails.
+
2004-12-01 Kim F. Storm <storm@cua.dk>
* alloc.c: Add commentary for last change.
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);
}