Convert encoding using ICU instead of iconv and add an encoding detector

Pending: MSVC support, then fixes #68.
You aren't checking this error code.