Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix Backslash Error
Description
libgda escapes the string on inserting it into the db. You can't change that behavior (as far as my research goes) So the easiest method to fix this, is to unescape the string on retrieval. This could escape a few things too many, but my testing resulted in no errors and the issues fixed. This could potentially also occur in other fields, not just "content", but I see no possibility to add arbitrary data in any other field and there is no escape character in the hard-coded option / choices of the other strings, or the serialized date etc.
I tested it locally, but it would be great if it would be tested by another one too, I will daily drive this for now and if I discover issues, (like swallowed characters due to unescaping) I will report it, but I think it's safe to use, since it didn't yield any errors from some manual tests with
\
heavy files (latex files).TODO:
Unescaping may fail, since there might be some wrong escape sequences in the string, so if the unescaping fails, we fallback to the escaped string, even if this should never fail, since it was escaped by libgda beforehand.
Fixes #196
Fixes #107
P.S: If this is merged, I also will file a PR to the legacy branch, to fix it in the Gnome < 45 too.
Type of change
Please delete options that are not relevant.
Checklist