BUG: When the cache key is CJK(Chinaese/Japanese/Korean) character

Topics: Developer Forum
Feb 18, 2008 at 5:13 AM
I try to cached some data:

IndexusDistributionCache.SharedCache.Add("用户数据:001", data);

But I can't get it again use this code:
IndexusDistributionCache.SharedCache.Get("用户数据:001", data);

I check you code, I found a BUG over here:

IndexusMessage.cs
public byte[] GetBytes()
{
...
bw.Write(this.key.Length);
bw.Write(System.Text.Encoding.UTF8.GetBytes(this.key));
bw.Write(payload == null ? 0 : payload.Length);
...
}

That's wrong when 'this.key' is CJK,please use this way:

byte [] arrKeyBytes = System.Text.Encoding.UTF8.GetBytes(this.key);
bw.Write(arrKeyBytes .Length);
bw.Write(arrKeyBytes );


Coordinator
Feb 18, 2008 at 11:28 AM
thanks for your input we gone update it asap.
Coordinator
Feb 18, 2008 at 11:28 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Coordinator
Feb 18, 2008 at 7:37 PM
This issue has been fixed and is gone be available with version 2.0.0.142 and upper

the checkin should happen within the next few hours.

thanks for reporting