Skip to content

Commit

Permalink
Fixed string attribute issue with special characters
Browse files Browse the repository at this point in the history
  • Loading branch information
desukuran committed Apr 7, 2024
1 parent a0a978f commit bb99539
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/PFire.Core/Protocol/XFireAttributes/StringAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ public override dynamic ReadValue(BinaryReader reader)
public override void WriteValue(BinaryWriter writer, dynamic data)
{
var value = (string)data ?? string.Empty;

writer.Write((short)value.Length);
writer.Write(Encoding.UTF8.GetBytes(value));
var bytes = Encoding.UTF8.GetBytes(value);
writer.Write((short)bytes.Length);
writer.Write(bytes);
}
}
}

0 comments on commit bb99539

Please sign in to comment.