Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- modified libgnucash/backend/xml/gnc-xml-helper.cpp
- @@ -31,9 +31,10 @@ checked_char_cast (gchar* val)
- const int length = -1; /* Assumes val is null-terminated */
- gchar* end;
- if (val == NULL) return NULL;
- - /* Replace any invalid UTF-8 characters with a sequence of '?' */
- - while (!g_utf8_validate (val, length, (const gchar**) (&end)))
- - *end = '?';
- + /* Replace any invalid UTF-8 characters with a sequence of 'U+FFFD' */
- +
- + g_utf8_make_valid (val, -1);
- +
- /* Replace any invalid (for XML) control characters (everything < 0x20
- * except \n, \t, and \r) with '?'. Technically we should replace
- * these with a numeric entity, but that will blow up the libxml
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement