Skip to content
Browse files

For ECData storing base64 string was not enough, so changed that to U…

…TF8 encoding.
  • Loading branch information...
1 parent 3ee6919 commit 144187aef75d0a98ac5fc8b0e90eb64a2c599f68 @mikkopa committed Nov 9, 2010
Showing with 5 additions and 4 deletions.
  1. +5 −4 ModularRex/RexFramework/ECData.cs
View
9 ModularRex/RexFramework/ECData.cs
@@ -36,13 +36,14 @@ public ECData(UUID entityId, string componentType, string componentName, byte[]
/// </summary>
/// <param name="entityId">The entity id.</param>
/// <param name="componentName">Name of the component.</param>
- /// <param name="data">The data as base64 string.</param>
+ /// <param name="data">The data as UTF8 string.</param>
public ECData(UUID entityId, string componentType, string componentName, string data)
{
m_entity_id = entityId;
m_component_type = componentType;
m_component_name = componentName;
- m_data = Convert.FromBase64String(data);
+ System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding();
+ m_data = encoding.GetBytes(data);
m_data_is_string = true;
}
@@ -88,8 +89,8 @@ public virtual byte[] Data
/// <summary>
/// Gets or sets a value indicating whether <c>Data</c> is string. If <c>Data</c> is string,
- /// it should be convertable from byte array back to string with method <c>ToBase64String</c>
- /// in <c>Convert</c> class.
+ /// it should be convertable from byte array back to string with method <c>GetBytes</c>
+ /// in <c>UTF8Encoding</c> class.
/// </summary>
/// <value><c>true</c> if <c>Data</c> is string otherwise, <c>false</c>.</value>
public virtual bool DataIsString

0 comments on commit 144187a

Please sign in to comment.
Something went wrong with that request. Please try again.