Helper classes to encode and decode UTF16 string to List.
It also supports encoding/decoding emojis.
This lib was created for another package and is specialized for this,
but it can be used anywhere. Also I am not a UTF-Pro, I just needed
an en/decoder and implemented a basic one.
If you find issues or need some other features, please fill the issue tracker.
Also I appreciate Pull Requests!
Add this line to your
and inside your dart class:
// Decide which encoder you want to use // BigEndian or LittleEndian final encoder = UTF16BE(); var bytes = encoder.encode('Hello World'); // bytes = [0, 72, 0, 101, 0, 108, 0, 108, 0, 111, 0, 32, 0, 87, 0, 111, 0, 114, 0, 108, 0, 100]