dbuenzli / uutf

Non-blocking streaming Unicode codec for OCaml
http://erratique.ch/software/uutf
ISC License
30 stars 15 forks source link

Expose byte position in the input stream #1

Closed whitequark closed 9 years ago

whitequark commented 9 years ago

This is useful for applications that want to correlate the decoded UTF-8 characters with their position in the original input stream.

whitequark commented 9 years ago

Essentially what I want is the byte counterpart to decoder_count.

dbuenzli commented 9 years ago

Man this patch is going to be ugly.

dbuenzli commented 9 years ago

No too ugly in the end. I was looking at the problem from the wrong perspective. Once I realized I always had the info on ret it was just a matter of changing that signature, the type system then simply told me were I had to make the changes.

whitequark commented 9 years ago

Thank you very much!