mirror of
https://github.com/msgpack/msgpack-python.git
synced 2025-10-22 13:23:17 +00:00
Implemented encoding for strings
* Packer by default uses `utf-8` encoding by default * Unpacker uses `None` by default, so no decoding is done * Both pack and unpack has `encoding` and `unicode_errors` arguments, if `encoding` is `None` no encoding/decoding is done, otherwise it is python codec. `unicode_errors` is supplied as `errors` parameter to codec
This commit is contained in:
parent
af7113bb31
commit
752e3d1b78
5 changed files with 169 additions and 25 deletions
|
@ -26,7 +26,7 @@ def test_decode_hook():
|
|||
unpacked = unpacks(packed, object_hook=_decode_complex)
|
||||
eq_(unpacked[1], 1+2j)
|
||||
|
||||
@raises(TypeError)
|
||||
@raises(ValueError)
|
||||
def test_bad_hook():
|
||||
packed = packs([3, 1+2j], default=lambda o: o)
|
||||
unpacked = unpacks(packed)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue