- char* utf8_str = convert_locale_to_utf8(locale_str);
-
- if (!utf8_str)
- gedcom_error(_("The input '%s' is not a valid string for the locale"),
- locale_str);
- else
- result = gom_set_string(data, utf8_str);
+
+ if (locale_str == NULL) {
+ result = gom_set_string(data, NULL);
+ }
+ else {
+ char* utf8_str = convert_locale_to_utf8(locale_str);
+
+ if (!utf8_str)
+ gedcom_error(_("The input '%s' is not a valid string for the locale"),
+ locale_str);
+ else
+ result = gom_set_string(data, utf8_str);
+ }