Skip to content

Commit

Permalink
(V1.0.0) FIX incorrect escape of "\\" character in Turtle
Browse files Browse the repository at this point in the history
  • Loading branch information
mdesalvo committed Oct 8, 2016
1 parent a503728 commit 8829bad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions RDFSharp/Model/Serializers/RDFTurtle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,11 @@ orderby triple.Subject.ToString(), triple.Predicate.ToString()
}

if (triple.Object is RDFTypedLiteral) {
String tLit = litValDelim + ((RDFTypedLiteral)triple.Object).Value.Replace("\"", "\\\"") + litValDelim + "^^" + RDFModelUtilities.GetDatatypeFromEnum(((RDFTypedLiteral)triple.Object).Datatype);
String tLit = litValDelim + ((RDFTypedLiteral)triple.Object).Value.Replace("\\","\\\\") + litValDelim + "^^" + RDFModelUtilities.GetDatatypeFromEnum(((RDFTypedLiteral)triple.Object).Datatype);
result.Append(RDFModelUtilities.AbbreviateNamespace(tLit));
}
else {
String pLit = litValDelim + ((RDFPlainLiteral)triple.Object).Value.Replace("\"", "\\\"") + litValDelim;
String pLit = litValDelim + ((RDFPlainLiteral)triple.Object).Value.Replace("\\","\\\\") + litValDelim;
if (((RDFPlainLiteral)triple.Object).Language != String.Empty) {
pLit = pLit + "@" + ((RDFPlainLiteral)triple.Object).Language;
}
Expand Down

0 comments on commit 8829bad

Please sign in to comment.