image-js / iobuffer

Read and write binary data in ArrayBuffers
http://image-js.github.io/iobuffer/
MIT License
43 stars 6 forks source link

feat: add readUtf8 and writeUtf8 #32

Closed targos closed 7 years ago

codecov-io commented 7 years ago

Current coverage is 100% (diff: 100%)

Merging #32 into master will not change coverage

@@           master   #32   diff @@
===================================
  Files           1     1          
  Lines         197   205     +8   
  Methods        43    45     +2   
  Messages        0     0          
  Branches       17    18     +1   
===================================
+ Hits          197   205     +8   
  Misses          0     0          
  Partials        0     0          

Powered by Codecov. Last update 2c6e104...6118a54

targos commented 7 years ago

@windwp is that what you need?

targos commented 7 years ago

@stropitek @maasencioh what do you think?

maasencioh commented 7 years ago

LGTM if you already test the utf8 library

targos commented 7 years ago

Thanks. Merged and released in v3.2.0

targos commented 7 years ago

Maybe it would make sense to also implement a readUtf8Char that is smart about the number of byte it reads.

Yeah, I don't know of a library that can do that. We should do it only if we know about a format that specifies the number of characters to read instead of the number of bytes.