Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
hhblaze committed Aug 24, 2018
1 parent e89de02 commit 2ef2e44
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions DBreeze/Utils/BiserJsonEncoder.cs
Expand Up @@ -45,24 +45,31 @@ public JsonEncoder(IJsonEncoder obj, JsonSettings settings = null)
void AddProp(string str)
{
if (lastchar != '{' && lastchar != '[' && lastchar != ',')
sb.Append(",");
sb.Append(",\"");
else
sb.Append("\"");

AddStr(str);
sb.Append(":");
sb.Append(str.Replace("\"", "\\\""));
sb.Append("\":");
//AddStr(str);
//sb.Append(":");
lastchar = ':';
}


void AddStr(string str)
{
sb.Append("\"");
foreach (var ch in str)
{
if (ch == '\"')
sb.Append('\\');
sb.Append(ch);
}

sb.Append("\"");
sb.Append(str.Replace("\"", "\\\""));

//foreach (var ch in str)
//{
// if (ch == '\"')
// sb.Append('\\');
// sb.Append(ch);
//}
sb.Append("\"");
}

void AddNull()
Expand Down

0 comments on commit 2ef2e44

Please sign in to comment.