Philip Martin <philip@codematters.co.uk> writes:
> 4. Property encoding
>
> append_prop_conflict assumes that the property values are valid
> UTF8. It's possible to have properties that are not UTF8 and
> append_prop_conflict will fail, and so the merge will abort.
> Perhaps we should escape non-UTF8 values, or simply write them
> without conversion?
How does this patch look to you?
[[[
* subversion/libsvn_wc/props.c
(append_prop_conflict): Convert conflict description from utf8 to
native fuzzily, since robustness is more important than accuracy.
Suggested by: philip
]]]
Index: subversion/libsvn_wc/props.c
===================================================================
--- subversion/libsvn_wc/props.c (revision 15884)
+++ subversion/libsvn_wc/props.c (working copy)
@@ -218,16 +218,13 @@
/* TODO: someday, perhaps prefix each conflict_description with a
timestamp or something? */
apr_size_t written;
- const svn_string_t *conflict_description_native;
+ const char *conflict_description_native =
+ svn_utf_cstring_from_utf8_fuzzy (conflict_description->data, pool);
- SVN_ERR (svn_utf_string_from_utf8 (&conflict_description_native,
- conflict_description,
- pool));
+ SVN_ERR (svn_io_file_write_full (fp, conflict_description_native,
+ strlen (conflict_description_native),
+ &written, pool));
- SVN_ERR (svn_io_file_write_full (fp, conflict_description_native->data,
- conflict_description_native->len, &written,
- pool));
-
return SVN_NO_ERROR;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Aug 22 23:26:53 2005