holochain / hdk-assemblyscript

The Holochain Developer Kit for Assemblyscript
41 stars 2 forks source link

Update serialize/deserialize to use AS builtins #25

Closed willemolding closed 5 years ago

willemolding commented 5 years ago

Closes #24

willemolding commented 5 years ago

The way it was originally will fail on multi-byte characters since the length will not be equal to the number of characters and the string will not decode correctly.

I have found some inconsistencies in how holochain core is passing string (see comments). To satisfy this I am checking if the last byte is null. This should be ok for now until we sort out the problem.

Also, I'm having troubles with getting the tests running at the moment so best check that this works before merging.

willemolding commented 5 years ago

I also suggest we add some test that attempt to pass and receive multi-byte chars from holochain to ensure we have that covered

Connoropolous commented 5 years ago

@willemolding what's an example of a multi-byte character? Can you add tests to cover those cases?

willemolding commented 5 years ago

Ok I added some tests cases and I'm happy with it. I'll go ahead and merge