| 855 | } |
| 856 | |
| 857 | static bool json_add_utf8(struct json_stream *js, |
| 858 | const char *fieldname, |
| 859 | const char *utf8str) |
| 860 | { |
| 861 | if (utf8_check(utf8str, tal_bytelen(utf8str))) { |
| 862 | json_add_stringn(js, fieldname, utf8str, tal_bytelen(utf8str)); |
| 863 | return true; |
| 864 | } |
| 865 | json_add_string(js, tal_fmt(tmpctx, "warning_invalid_%s", fieldname), |
| 866 | "invalid UTF8"); |
| 867 | return false; |
| 868 | } |
| 869 | |
| 870 | static void json_add_recurrence(struct json_stream *js, |
| 871 | const char *fieldname, |
no test coverage detected