Closed moogle19 closed 9 years ago
I'll try to look at this in the next few days, but if I can't, the fastest way to fix this is, if possible, for you to submit a pull request. Thanks.
I can reproduce this error with your testcases:
let packed = pack(.String("Hellö wörld"))
let unpacked = try? unpack(packed)
XCTAssertEqual(unpacked, MessagePackValue.String("Hellö, wörld!"))
I'll take a look, since I modified the unpack routine for Strings...
Closed by #13.
Characters like ä,ö,ü,é,ß doesn't unpack correctly. Packing works, but the problem with unpacking is, that these characters consist of 2 bytes instead of 1. So the unpackString method handles the character as 2 characters.
Also the determination of the string length looks wrong. The length should be "value & 0x1f" and not "value - 0xa0" if I understand it correctly.