nlf / protobuf.js

A super rough, super simple, protocol buffer encoding library
24 stars 7 forks source link

Use wtf8 for string encoding #2

Closed keikku closed 11 years ago

keikku commented 11 years ago

Current butils implementation does not support reading UTF-8 strings (e.g. reading such from riak breaks the protocol as s.length != Buffer.byteLength(s)). This commit uses native addon module https://github.com/lautis/wtf8 for encoding/decoding UTF-8. It also appears to be about 1.5 (read) to 2 (write) times faster than the butils JavaScript counterparts.

Btw. I did not mind @roidrage submitting the riakpbc spec path patch ;)

nlf commented 11 years ago

Makes sense to me. Thanks for the patch!