Ok, after more research / tests, fixed those:
- fixed 2 & 3 bytes character codes handled incorrectly
- added compatibility with surrogate pairs
- fixed missing file's CloseHandle
Not sure, how actual, Doctor McKay seems not active, anyway, created a pull request.
More improvements are welcomed.
The topic is seems solved.
Also, made a scheme, as a helper to understand the stuff (in attachment).